public void AddNewWorkerTest()
        {
            var mockSet = new Mock <DbSet <Worker> >();

            var EmpList = new List <EmployeeDetail>()
            {
                new EmployeeDetail()
                {
                    EmpID      = 1,
                    ID         = 1, //1 - Employee, 2 - Supervisor, 3 - Manager
                    PayperHour = 50
                }
            };

            var worker = new Worker()
            {
                ID              = 1,
                FirstName       = "Mike",
                LastName        = "Anderson",
                Address1        = "New York",
                EmployeeDetails = EmpList,
                WorkerTypeID    = 1
            };

            Mock <IWorkerMoq> mockContext = new Mock <IWorkerMoq>();

            mockContext.Setup(m => m.AddNewWorker(It.IsAny <Worker>()));
            WorkerMoq workerMoq = new WorkerMoq();
            var       result    = workerMoq.AddNewWorkerMoq(mockContext.Object, worker);

            Assert.IsTrue(result == worker);
        }
Exemple #2
0
 public void Clear()
 {
     field = null;
     robot = null;
 }
Exemple #3
0
 public void Init()
 {
     field = new FieldMoq();
     robot = new WorkerMoq();
 }
Exemple #4
0
 public void CLear()
 {
     robot = null;
     cmd   = null;
 }
Exemple #5
0
 public void Init()
 {
     robot = new WorkerMoq();
     cmd   = new MoveUpCommand(robot);
 }