Пример #1
0
        public void AddPersonTest()
        {
            // Assign
              var data = new FakeData();
              var manager = new APIManager(data);
              var person = new Person
              {
            fio = MoqDataGenerator.GetRandomString(10),
            salary = MoqDataGenerator.GetRandomNumber(1, 100),
            salaryDate = MoqDataGenerator.GetRandomDate()
              };

              // Action
              manager.AddNewPeoplePeopleSalary(person);

              // Assert
              Assert.AreEqual(data.Peoples.Count(), 2);
              Assert.AreEqual(data.PeopleSalaries.Count(), 2);
              Assert.AreEqual(person.fio, data.Peoples.Last().FIO);
              Assert.AreEqual(person.salary, data.PeopleSalaries.Last().Salary);
              Assert.AreEqual(person.salaryDate, data.PeopleSalaries.Last().SalaryDate);
        }
Пример #2
0
 /*
   аргумент получаем от Dependecy Resolver Unity
 */
 public APIController(IData d)
 {
   data = d;
   manager = new APIManager(data);
 }