public void AddEmployee_Should_AddPosition()
        {
            var dbContext = new PayrollContext();
            var empRepo   = new GenericRepository <Employee>(dbContext);
            var uow       = new UnitOfWork(dbContext);
            var config    = new MapperConfiguration(cfg => cfg.CreateMap <EmployeeViewModel, Employee>());
            var mapper    = new Mapper(config);

            var service = new HumanResourceService(empRepo, uow);

            var result = service.AddEmployee(new Employee()
            {
                Fname    = "Sonny",
                Mname    = "Ramirez",
                Lname    = "Recio(Data)",
                Position = new Position()
                {
                    BaseSalary         = 15000M,
                    IncreasePercentage = 15,
                    Name = "Jr. Programmer"
                }
            });

            Assert.AreEqual("Recio", result.Lname);

            //service.RemoveEmployee(result.Id);
        }
        public void AddEmployee_Should_AddToDb()
        {
            var dbContext = new PayrollContext();
            var empRepo   = new GenericRepository <Employee>(dbContext);
            var uow       = new UnitOfWork(dbContext);
            var config    = new MapperConfiguration(cfg => cfg.CreateMap <EmployeeViewModel, Employee>());
            var mapper    = new Mapper(config);

            var service = new HumanResourceService(empRepo, uow);

            var result = service.AddEmployee(new DDD.Domain.ViewModels.EmployeeViewModel()
            {
                Fname = "Sonny",
                Mname = "Ramirez",
                Lname = "Recio"
            });

            Assert.AreEqual("Recio", result.Lname);

            service.RemoveEmployee(result.Id);
        }
        public void AddEmployee_Should_Add()
        {
            var uowStub        = Substitute.For <IUnitOfWork>();
            var repositoryStub = Substitute.For <IGenericRepository <Employee> >();
            var deptStub       = Substitute.For <IGenericRepository <Department> >();
            var mapperStub     = Substitute.For <IMapper>();
            var empLists       = new List <Employee>();

            var service = new HumanResourceService(repositoryStub, deptStub, uowStub);
            //mapperStub.Map<EmployeeViewModel, Employee>(Arg.Any<EmployeeViewModel>()).Returns(new Employee() {
            //    Fname = "Sonny",
            //    Lname = "Recio"
            //});
            var result = service.AddEmployee(new EmployeeViewModel()
            {
                Fname = "Sonny",
                Lname = "Recio"
            });


            Assert.AreEqual("Recio", result.Lname);
        }