Exemplo n.º 1
0
        public void Container_RegisterInstance_should_call_container_to_register_instance_if_SUT_not_set()
        {
            var instance = new ConcreteObjectWithNoConstructor();
            var sut = CreateSut();

            sut.Container.Register(instance);

            sut.Container.SourceContainer.Received().Register(instance);
        }
Exemplo n.º 2
0
        public void should_be_able_to_set_sut_independently()
        {
            var instance = new ConcreteObjectWithNoConstructor();
            var sut = CreateSut();
            var original = sut.SUT;

            sut.SUT = instance;

            sut.SUT.ShouldBeSameAs(instance);
            sut.SUT.ShouldNotBeSameAs(original);
        }