Skip to content

Commit bca87b0

Browse files
authored
Merge pull request #24 from Atypical-Consulting/unit-tests
Create ServiceCollectionExtensionsTests.cs
2 parents 9afab2a + e34725c commit bca87b0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2022, Atypical Consulting SRL
2+
// All rights reserved.
3+
//
4+
// This source code is licensed under the BSD-style license found in the
5+
// LICENSE file in the root directory of this source tree.
6+
7+
using Atypical.VirtualFileSystem.Core.Contracts;
8+
using Atypical.VirtualFileSystem.Core.Services;
9+
using Microsoft.Extensions.DependencyInjection;
10+
11+
namespace VirtualFileSystem.UnitTests.Services;
12+
13+
public class ServiceCollectionExtensionsTests
14+
{
15+
public class MethodAddVirtualFileSystem
16+
{
17+
[Fact]
18+
public void AddVirtualFileSystem_registers_VirtualFileSystem_in_DI()
19+
{
20+
// Arrange
21+
var services = new ServiceCollection();
22+
23+
// Act
24+
services.AddVirtualFileSystem();
25+
26+
// Assert
27+
services.Should()
28+
.Contain(service => service.ServiceType == typeof(IVirtualFileSystem)
29+
&& service.ImplementationType == typeof(VFS)
30+
&& service.Lifetime == ServiceLifetime.Scoped);
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)