コード例 #1
0
        public void Task_Add_ValidData_Return_Match()
        {
            //Arrange
            var id            = 1;
            var appointmentId = 1;
            var emp           = new EmployeeAppointment()
            {
                AppointmentId = appointmentId, Id = id
            };

            EmployeeAppointmentRepositoryMock.Setup(m => m.Save(emp)).Returns(emp).Verifiable();

            //Act
            var actual = EmployeeAppointmentsBusinessManager.Save(emp);

            //Assert
            Assert.IsInstanceOfType(actual, typeof(BussinessCustomResponse <EmployeeAppointment>));     //passes
        }
コード例 #2
0
        public void Task_Add_Success_Return_True()
        {
            //Arrange
            var id            = 1;
            var appointmentId = "ahmed14";
            var emp           = new EmployeeAppointment()
            {
                AppointmentId = 1, Id = id
            };

            EmployeeAppointmentRepositoryMock.Setup(m => m.Save(emp)).Returns(emp).Verifiable();

            //Act
            var actual = EmployeeAppointmentsBusinessManager.Save(emp);

            //Assert
            Assert.AreEqual(true, actual.Success);//assert success
        }
コード例 #3
0
        private void TestSupplierAppointment()
        {
            try
            {
                //Utility.WriteLog(2000, 5, "IN - SPAR MAPPER Email Notification Start", "Information", TraceEventType.Information, moduleName);
                Log.ErrorFileWrite(moduleName, "4001", "IN - SPAR MAPPER Employee Appointment Notification Start");

                EmployeeAppointment.InsertTempGoConnect();

                //Utility.WriteLog(2001, 5, "IN - SPAR MAPPER Email Notification End", "Information", TraceEventType.Information, moduleName);
                Log.ErrorFileWrite(moduleName, "4002", "IN - SPAR MAPPER Employee Appointment Notification End");
                Application.Exit();
            }
            catch (Exception ex)
            {
                //Utility.WriteLog(2002, 5, ex.Message, "Exception", TraceEventType.Error, moduleName);
                Log.ErrorFileWrite(moduleName, "4003", ex.Message, ex.StackTrace);
                Application.Exit();
            }
        }