public async Task GetPaperProfit() { var profit1 = await _portfolioService.GetPaperProfit(10, 1); var profit2 = await _portfolioService.GetPaperProfit(11, 1); var profit3 = await _portfolioService.GetPaperProfit(12, 2); var profit4 = await _portfolioService.GetPaperProfit(12, 1); Assert.IsTrue(profit1.IsSuccess, "Неуспешное выполнение операции"); Assert.AreEqual(34720 * 2 + 26580 * 2 + 20000 + 6283 - 100000, profit1.Result.Value, "Неверная прибыль"); Assert.AreEqual(FinanceHelpers.DivWithOneDigitRound(34720 * 2 + 26580 * 2 + 20000 + 6283 - 100000, 2000000), profit1.Result.Percent, "Неверный процент"); Assert.IsTrue(profit2.IsSuccess, "Неуспешное выполнение операции"); Assert.AreEqual(26580, profit2.Result.Value, "Неверная прибыль"); Assert.AreEqual(FinanceHelpers.DivWithOneDigitRound(26580, 1000000), profit2.Result.Percent, "Неверный процент"); Assert.IsTrue(profit3.IsSuccess, "Неуспешное выполнение операции"); Assert.AreEqual(34720, profit3.Result.Value, "Неверная прибыль"); Assert.AreEqual(FinanceHelpers.DivWithOneDigitRound(34720, 1500000), profit3.Result.Percent, "Неверный процент"); Assert.IsFalse(profit4.IsSuccess, "Прибыль в чужом портфеле"); }