public void GetSummarizedLogAsStringTest_NoErrors_ShouldReturnNoLogs()
        {
            ErrorLogger.GetLogList().Clear();
            seeder.InitList();

            const string expected = "No Logs";
            var          actual   = ErrorLogger.GetSummarizedLogAsString();

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void GetCalculatedDataToStringTest_SendInEcoController_ReturnsCollectedDataAsString()
        {
            seeder.InitList();
            BudgetReport report = new(seeder.ecoController);
            var          actual = report.GetCalculatedDataToString().Trim();
            WriteToFile  writer = new();

            //In case file already exists--
            writer.WriteStringToFile("test file", report.GetCalculatedDataToString());
            File.Delete(writer.PathAndFileName);
            //--

            writer.WriteStringToFile("test file", report.GetCalculatedDataToString());
            string expected = File.ReadAllText(writer.PathAndFileName).Trim();

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void GetTotalIncomeTest_Pass_ShouldReturnSum_14000()
        {
            seeder.InitList();
            calc = new Calculator(seeder.ecoController);

            const int expected = 14000;
            var       actual   = calc.GetTotalIncome();

            Assert.AreEqual(expected, actual);
        }