public void Convert_correctly_converts_PortfolioFileInfo() { // arrange var portfolioFileInfo = "foo bar bat"; var request = new PortfolioCalculationRequest { PortfolioFileInfo = portfolioFileInfo }; var provider = new PortfolioCalculationRequestProvider(); // act var model = provider.Convert(request); // assert Assert.That(model.PortfolioFileInfo, Is.EqualTo(portfolioFileInfo)); }
public void Convert_correctly_converts_list() { // arrange var guid = Guid.NewGuid().ToString(); var provider = new PortfolioCalculationRequestProvider(); var inputList = new List<PortfolioCalculationRequest> { new PortfolioCalculationRequest {RequestId = guid}, }; // act var convertedList = provider.Convert(inputList).ToList(); // assert Assert.That(convertedList, Is.TypeOf<List<PortfolioCalculationRequestViewModel>>()); Assert.That(convertedList.Count, Is.EqualTo(1)); Assert.That(convertedList.First().RequestId, Is.EqualTo(guid)); }
public void Convert_correctly_converts_RequestId() { // arrange var guid = Guid.NewGuid().ToString(); var request = new PortfolioCalculationRequest {RequestId = guid}; var provider = new PortfolioCalculationRequestProvider(); // act var model = provider.Convert(request); // assert Assert.That(model.RequestId, Is.EqualTo(guid)); }
public void Convert_correctly_converts_RequestDate() { // arrange var requestDate = new DateTime(2011, 2, 3, 15, 3, 21); var ts = requestDate.ToTimestamp(); var request = new PortfolioCalculationRequest { RequestTimestamp = ts }; var provider = new PortfolioCalculationRequestProvider(); // act var model = provider.Convert(request); // assert Assert.That(model.RequestTimestamp, Is.EqualTo(ts)); }
public void Convert_correctly_converts_Status() { // arrange var status = PortfolioCalculationRequestStatus.Error; var request = new PortfolioCalculationRequest { Status = status }; var provider = new PortfolioCalculationRequestProvider(); // act var model = provider.Convert(request); // assert Assert.That(model.Status, Is.EqualTo(status)); }