Example #1
0
        public void Register_And_Return_Callbacks()
        {
            var sut = new MockContainerBuilder();

            Action <IComponentRegistryBuilder> cb1 = registry => { };

            sut.RegisterCallback(cb1);
            sut.Callbacks.Single().Callback.Should().Be(cb1);

            Action <IComponentRegistryBuilder> cb2 = registry => { };

            sut.RegisterCallback(cb2);
            sut.Callbacks.Last().Callback.Should().Be(cb2);
        }
Example #2
0
        public void Register_And_Return_Callbacks()
        {
            var sut = new MockContainerBuilder();

            Action <IComponentRegistry> cb1 = registry => { };

            sut.RegisterCallback(cb1);
            sut.Callbacks.Should().HaveCount(1);
            sut.Callbacks.Should().OnlyContain(action => action == cb1);

            Action <IComponentRegistry> cb2 = registry => { };

            sut.RegisterCallback(cb2);
            sut.Callbacks.Should().HaveCount(2);
            sut.Callbacks.Should().OnlyContain(action => action == cb1 || action == cb2);
        }