Example #1
0
            public void ThrowsInvalidOperationWhenIOExceptionThrownAndDestroyed()
            {
                Container.Destroy();
                ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); });

                Assert.Throws <InvalidOperationException>(() => Container.GetProperties());
            }
Example #2
0
            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);
            }
Example #3
0
            public void PassesThroughExceptionIfNotDestroyed()
            {
                ContainerPropertiesService.GetProperties(Container).Returns(x => { throw new IOException(); });

                Assert.Throws <IOException>(() => Container.GetProperties());
            }