Exemplo n.º 1
0
        public void WithUpconvertersFrom_UpconverterContainerAssembly_ShouldLoadPublicUpconvertersOfPublicEvents()
        {
            // Arrange
            var sut = new ConfigurationStub();

            // Act
            sut.WithUpconvertersFrom(typeof(BullOak.Repositories.Test.Unit.UpconverterContainer.EventA).Assembly)
            .AndNoMoreUpconverters()
            .Build();

            // Assert
            sut.GetUpconvertFunctions()
            .Any(x => x.Key == typeof(UpconverterContainer.EventA))
            .Should().BeTrue();
            sut.GetUpconvertFunctions()
            .Any(x => x.Key == typeof(UpconverterContainer.EventB))
            .Should().BeTrue();
        }
Exemplo n.º 2
0
        public void WithUpconvertersFrom_OneUpconverterTypeAndOneOtherType_ShouldAddOneUpconverterInList()
        {
            // Arrange
            var sut  = new ConfigurationStub();
            var data = new Type[]
            {
                GetType(),
                typeof(UpconverterAToB)
            };

            // Act
            sut.WithUpconvertersFrom(data)
            .AndNoMoreUpconverters()
            .Build();

            // Assert
            var upconvertFuncs = sut.GetUpconvertFunctions();

            upconvertFuncs.Should().NotBeNull();
            upconvertFuncs.Length.Should().Be(1);
            upconvertFuncs[0].Key.Should().Be <EventA>();
        }