public void ThrowsInvalidOperationWhenIOExceptionThrownAndDestroyed() { Container.Destroy(); ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); }); Assert.Throws <InvalidOperationException>(() => Container.GetProperties()); }
public void ReturnsProperties() { var properties = new Dictionary <string, string>() { { "name1", "value1" }, { "name2", "value2" }, }; ContainerPropertiesService.GetProperties(Container).Returns(properties); var info = Container.GetInfo(); Assert.Equal( new HashSet <string>(properties.Keys), new HashSet <string>(info.Properties.Keys) ); }
public void PassesThroughExceptionIfNotDestroyed() { ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); }); Assert.Throws <IOException>(() => Container.GetProperties()); }
public GetProperties() { Properties = new Dictionary <string, string>(); ContainerPropertiesService.GetProperties(Container).Returns(Properties); }