public void AgentWhoReceivedAbsence_AbsenceCouldBeRemoved()
        {
            using (ShimsContext.Create())
            {
                var agnt = new Agent("مبین فانی", 1, "امیر", "1234567890", new DateTime(1397, 1, 1),
                                     "(912)1234567", "(21)12345678", 1, -1);
                data.access.Fakes.ShimRepository <Agent> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(agnt); };
                data.access.Fakes.ShimRepository <Absence> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(new Absence(DateTime.Now.Date, agnt.MisRef, CrntUser.SesId)); };
                data.access.Fakes.ShimRepository <Absence> .AllInstances.UpdT0 =
                    delegate { return(true); };

                var biz = new BizProvider("lab");
                biz.RemoveTheAgentsIteration <Absence>(agnt.Id, DateTime.Now.Date);
            }
        }
Example #2
0
        public void AgentWithOffDay_CouldCancelOffDay()
        {
            using (ShimsContext.Create())
            {
                var agnt = new Agent("سینا پرنیان", 1, "غلام", "1234567890", new DateTime(1397, 1, 1),
                                     "(912)1234567", "(21)12345678", 1, -1);
                data.access.Fakes.ShimRepository <Agent> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(agnt); };
                data.access.Fakes.ShimRepository <OffDay> .AllInstances.RetExpressionOfFuncOfT0Boolean =
                    delegate { return(new OffDay(DateTime.Now.Date, agnt.Id, CrntUser.SesId)); };
                data.access.Fakes.ShimRepository <OffDay> .AllInstances.UpdT0 =
                    delegate { return(true); };

                var biz = new BizProvider("lab");
                biz.RemoveTheAgentsIteration <OffDay>(agnt.Id, DateTime.Now.Date);
            }
        }