Skip to content

Commit

Permalink
Merge pull request #24 from Atypical-Consulting/unit-tests
Browse files Browse the repository at this point in the history
Create ServiceCollectionExtensionsTests.cs
  • Loading branch information
phmatray authored Feb 4, 2023
2 parents 9afab2a + e34725c commit bca87b0
Showing 1 changed file with 33 additions and 0 deletions.
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);
}
}
}

0 comments on commit bca87b0

Please sign in to comment.