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

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

                Assert.Throws <IOException>(() => Container.GetProperties());
            }
Exemplo n.º 4
0
            public GetProperties()
            {
                Properties = new Dictionary <string, string>();

                ContainerPropertiesService.GetProperties(Container).Returns(Properties);
            }