public void ThrowsInvalidOperationWhenIOExceptionThrownAndDestroyed() { Container.Destroy(); ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); }); Assert.Throws <InvalidOperationException>(() => Container.GetProperties()); }
public void ReturnsProperties() { Properties["Name"] = "Value"; var properties = Container.GetProperties(); Assert.Collection(properties, x => { Assert.Equal("Name", x.Key); Assert.Equal("Value", x.Value); } ); ContainerPropertiesService.Received(1).GetProperties(Container); }
public void PassesThroughExceptionIfNotDestroyed() { ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); }); Assert.Throws <IOException>(() => Container.GetProperties()); }