public void Unknown_Format_Should_Return_Null() { // Arrange var registry = new ArchiverRegistry(new NullLogger <ArchiverRegistry>()); registry.Initialize(); // Act var archiver = registry.Lookup("unknown"); // Assert archiver.Should().BeNull(); }
public void Zip_Format_Should_Return_ZipArchiver() { // Arrange var registry = new ArchiverRegistry(new NullLogger <ArchiverRegistry>()); registry.Initialize(); // Act var archiver = registry.Lookup("zip"); // Assert archiver.Should().NotBeNull(); archiver.Should().BeOfType <ZipArchiver>(); }
public void Initialize_Should_Reset_State() { // Arrange var registry = new ArchiverRegistry(new NullLogger <ArchiverRegistry>()); registry.Initialize(); var myArchiver = new Mock <IArchiver>(); myArchiver.Setup(a => a.GetPackaging()).Returns("mypackaging"); registry.Register(myArchiver.Object); // Act var archiver = registry.Lookup("mypackaging"); // Assert archiver.Should().NotBeNull(); // Act registry.Initialize(); archiver = registry.Lookup("mytype"); // Assert archiver.Should().BeNull(); }