Esempio n. 1
0
        public void Test_Get_Georgian_CloseDate()
        {
            //Arrange
            var fakeModel = new AdmissionModel()
            {
                DateOfClose = _date
            };
            var fakeAdmissionLogic = new Business.AdmissionLogic();

            //Act
            var actualResult = fakeAdmissionLogic.GetGeorgianCloseDate(fakeModel);

            //Assert
            Assert.Equal(fakeModel.DateOfClose, actualResult);
        }
Esempio n. 2
0
        public void Test_Course_Specification(string courseName, int duration, int capacity)
        {
            //Arrange
            var fakeModel = new AdmissionModel()
            {
                Course             = courseName,
                Duration           = duration,
                CapacityOfStudents = capacity
            };
            var fakeAdmissionLogic = new Business.AdmissionLogic();

            //Act
            var actualResult = fakeAdmissionLogic.CourseSpecification(fakeModel);

            //Assert
            Assert.Equal($"The Course '{fakeModel.Course}' will carry out in {fakeModel.Duration} hours with the number of {fakeModel.CapacityOfStudents} Students", actualResult);
        }
Esempio n. 3
0
        public void Test_Capacity_Exceed(string courseName, int submited, int capacity)
        {
            //Arrange
            var fakeModel = new AdmissionModel()
            {
                Course = courseName,
                NumberOfSubmittedStudents = submited,
                CapacityOfStudents        = capacity
            };
            var fakeAdmissionLogic = new Business.AdmissionLogic();

            //Act
            var actualResult = fakeAdmissionLogic.CapacityExceed(fakeModel);

            //Assert
            Assert.Equal($"The course {fakeModel.Course} has reached the maximum size of capacity", actualResult);
        }
Esempio n. 4
0
        public void Test_Get_Persian_CloseDate()
        {
            //Arrange
            var fakeModel = new AdmissionModel()
            {
                DateOfClose = _date
            };
            var fakeAdmissionLogic = new Business.AdmissionLogic();

            //Act
            var actualResult = fakeAdmissionLogic.GetPersianCloseDate(fakeModel);

            //Assert
            System.Globalization.PersianCalendar pdate = new System.Globalization.PersianCalendar();
            var closeYear  = pdate.GetYear(fakeModel.DateOfClose);
            var closeMonth = pdate.GetMonth(fakeModel.DateOfClose);
            var closeDay   = pdate.GetDayOfMonth(fakeModel.DateOfClose);

            Assert.Equal($"{closeYear}/{closeMonth.ToString().PadLeft('0')}/{closeDay.ToString().PadLeft('0')}", actualResult);
        }