コード例 #1
0
        private static LinesSourceManager CreateManager(ISelkieLogger logger,
                                                        ISelkieBus bus,
                                                        ISelkieInMemoryBus inMemoryBus)
        {
            var factory = Substitute.For <ILinesSourceFactory>();
            factory.Create(Arg.Any <IEnumerable <ILine>>()).Returns(CreateLinesSource);

            var converter = new TestLinesDtoToLinesConverter();

            return new LinesSourceManager(logger,
                                          bus,
                                          inMemoryBus,
                                          factory,
                                          converter);
        }
コード例 #2
0
        public void CreateLine_ReturnsLine_ForLineDtoRunDirectionUnknown()
        {
            // Arrange
            LineDto lineDto = CreateLineDtoRunDirectionUnknown();
            var sut = new TestLinesDtoToLinesConverter();

            // Act
            ILine actual = sut.CreateLine(lineDto);

            // Assert
            AssertLineUnknown(actual);
        }
コード例 #3
0
        public void Dtos_Roundtrip()
        {
            // Arrange
            LineDto[] lineDtos = CreateLineDtos();

            // Act
            var sut = new TestLinesDtoToLinesConverter
                      {
                          Dtos = lineDtos
                      };

            // Assert
            Assert.NotNull(sut.Dtos);
            Assert.True(lineDtos.SequenceEqual(sut.Dtos));
        }
コード例 #4
0
        public void Convert_SetsLines_WhenCalled()
        {
            // Arrange
            LineDto[] lineDtos = CreateLineDtos();
            var sut = new TestLinesDtoToLinesConverter
                      {
                          Dtos = lineDtos
                      };

            // Act
            sut.Convert();

            // Assert
            Assert.AreEqual(2,
                            sut.Lines.Count());
        }