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); }
public void CreateLine_ReturnsLine_ForLineDtoRunDirectionUnknown() { // Arrange LineDto lineDto = CreateLineDtoRunDirectionUnknown(); var sut = new TestLinesDtoToLinesConverter(); // Act ILine actual = sut.CreateLine(lineDto); // Assert AssertLineUnknown(actual); }
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)); }
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()); }