Пример #1
0
        public void MapBOToEF()
        {
            var mapper = new DALEmployeeMapper();
            var bo     = new BOEmployee();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), true, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", 1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), true, 1, 1);

            Employee response = mapper.MapBOToEF(bo);

            response.BirthDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.BusinessEntityID.Should().Be(1);
            response.CurrentFlag.Should().Be(true);
            response.Gender.Should().Be("A");
            response.HireDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.JobTitle.Should().Be("A");
            response.LoginID.Should().Be("A");
            response.MaritalStatu.Should().Be("A");
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.NationalIDNumber.Should().Be("A");
            response.OrganizationLevel.Should().Be(1);
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.SalariedFlag.Should().Be(true);
            response.SickLeaveHour.Should().Be(1);
            response.VacationHour.Should().Be(1);
        }
Пример #2
0
        public void MapBOToModelList()
        {
            var        mapper = new BOLEmployeeMapper();
            BOEmployee bo     = new BOEmployee();

            bo.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), true, "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), "A", 1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), true, 1, 1);
            List <ApiEmployeeResponseModel> response = mapper.MapBOToModel(new List <BOEmployee>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Пример #3
0
        public void MapBOToModelList()
        {
            var        mapper = new BOLEmployeeMapper();
            BOEmployee bo     = new BOEmployee();

            bo.SetProperties(1, "A", true, true, "A");
            List <ApiEmployeeResponseModel> response = mapper.MapBOToModel(new List <BOEmployee>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Пример #4
0
        public void MapBOToModel()
        {
            var        mapper = new BOLEmployeeMapper();
            BOEmployee bo     = new BOEmployee();

            bo.SetProperties(1, "A", true, true, "A");
            ApiEmployeeResponseModel response = mapper.MapBOToModel(bo);

            response.FirstName.Should().Be("A");
            response.Id.Should().Be(1);
            response.IsSalesPerson.Should().Be(true);
            response.IsShipper.Should().Be(true);
            response.LastName.Should().Be("A");
        }
Пример #5
0
        public void MapBOToEF()
        {
            var mapper = new DALEmployeeMapper();
            var bo     = new BOEmployee();

            bo.SetProperties(1, "A", true, true, "A");

            Employee response = mapper.MapBOToEF(bo);

            response.FirstName.Should().Be("A");
            response.Id.Should().Be(1);
            response.IsSalesPerson.Should().Be(true);
            response.IsShipper.Should().Be(true);
            response.LastName.Should().Be("A");
        }