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.Set(instance);

            sut.Container.SourceContainer.Received().Register(instance);
        }
Exemplo n.º 2
0
        public void SetInstance_should_register_instance_if_SUT_not_set()
        {
            var instance = new ConcreteObjectWithNoConstructor();
            var sut      = this.CreateSut <ConcreteObjectWithMultipleConstructors>();

            sut.Set(instance);

            sut.SourceContainer.Received().Set(instance);
        }
Exemplo n.º 3
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.º 4
0
        public void should_be_able_to_set_sut_independently()
        {
            var instance = new ConcreteObjectWithNoConstructor();
            var sut      = this.CreateSut <ConcreteObjectWithNoConstructor>();
            var original = sut.SystemUnderTest;

            sut.SystemUnderTest = instance;

            sut.SystemUnderTest.ShouldBeSameAs(instance);
            sut.SystemUnderTest.ShouldNotBeSameAs(original);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }