-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Atypical-Consulting/unit-tests
Create ServiceCollectionExtensionsTests.cs
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
tests/Atypical.VirtualFileSystem.UnitTests/Services/ServiceCollectionExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2022, Atypical Consulting SRL | ||
// All rights reserved. | ||
// | ||
// This source code is licensed under the BSD-style license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
|
||
using Atypical.VirtualFileSystem.Core.Contracts; | ||
using Atypical.VirtualFileSystem.Core.Services; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace VirtualFileSystem.UnitTests.Services; | ||
|
||
public class ServiceCollectionExtensionsTests | ||
{ | ||
public class MethodAddVirtualFileSystem | ||
{ | ||
[Fact] | ||
public void AddVirtualFileSystem_registers_VirtualFileSystem_in_DI() | ||
{ | ||
// Arrange | ||
var services = new ServiceCollection(); | ||
|
||
// Act | ||
services.AddVirtualFileSystem(); | ||
|
||
// Assert | ||
services.Should() | ||
.Contain(service => service.ServiceType == typeof(IVirtualFileSystem) | ||
&& service.ImplementationType == typeof(VFS) | ||
&& service.Lifetime == ServiceLifetime.Scoped); | ||
} | ||
} | ||
} |