[TestCase(4, "Ok", 0)] // zero qty public void ShouldReturnNull_WhenInvalidInput(decimal price, string name, int qty) { IAnalysis result = new AnalysisBuilder() .SetClosingPrice(price) .SetName(name) .SetQtyInBuyingPacket(qty) .SetTechnicalAnalysis(new TechnicalAnalysisBuilder() .SetFastSMA(1) .SetSlowSMA(2) .Build()) .Build(); result.Should().BeNull(); }
public void ShouldReturnValidObject_WhenValidInput(decimal price, string name, int qty) { ITechnicalAnalysis technicalAnalysis = new TechnicalAnalysisBuilder() .SetFastSMA(1) .SetSlowSMA(2) .Build(); IAnalysis result = new AnalysisBuilder() .SetClosingPrice(price) .SetName(name) .SetQtyInBuyingPacket(qty) .SetTechnicalAnalysis(technicalAnalysis) .Build(); result.Should().NotBeNull(); result.ClosingPrice.Should().Be(price); result.Name.Should().Be(name); result.QtyInBuyingPacket.Should().Be(qty); result.TechnicalAnalysis.Should().Be(technicalAnalysis); }