Пример #1
0
        public Associate CreateAssociate(Associate associate)
        {
            var addedAssociate = associatesRepository.AddAssociate(associate);

            unitOfWork.Commit();
            return(addedAssociate);
        }
        public void CreateAssociateTest()
        {
            var input = new Associate
            {
                Associate_Id     = 567894,
                Name             = "TestRepositoryAssociate",
                Email            = "*****@*****.**",
                Mobile           = "1234567890",
                Gender           = "Male",
                Status_Blue      = false,
                Status_Green     = true,
                Status_Red       = false,
                Level_1          = true,
                Level_2          = false,
                Level_3          = false,
                Pic              = "",
                Remark           = "Na",
                Strength         = "Na",
                Other            = "Na",
                Weakness         = "",
                Associate_Skills =
                {
                    new Associate_Skills {
                        Associate_Id = 575566, Rating = 5, Skill_Id = 5
                    },
                    new Associate_Skills {
                        Associate_Id = 575566, Rating = 5, Skill_Id = 6
                    }
                }
            };
            var associate = associatesRepository.AddAssociate(input);

            unitOfWork.Commit();
            Assert.NotNull(associate);
            Assert.AreEqual(associate.Associate_Id, input.Associate_Id);
        }
 public Associate CreateAssociate(Associate associate)
 {
     return(associatesRepository.AddAssociate(associate));
 }