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

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

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