public bool CreateComapnyGroup(Group group) { try { //group.CompanyGroupList.ForEach(p=>p.DefaultRebate/=100); CompanyService.CreateCompanyGroup(this.CurrentCompany.CompanyId, group.CompanyGroup, group.CompanyGroupList, this.CurrentUser.UserName); } catch (Exception) { return(false); } return(true); }
public void CreateCompanyGroupTest() { Guid ownerId = new Guid("67007e18-a8ee-4ce0-b860-ae81ddd2a4f3"); // TODO: 初始化为适当的值 CompanyGroup group = new CompanyGroup() { Id = Guid.NewGuid(), Name = "复仇者联盟", Description = "都是英雄", AllowExternalPurchase = true, Company = ownerId, CreateTime = DateTime.Now, LastModifyTime = DateTime.Now, Creator = "lanlan" }; IEnumerable <Guid> members = new List <Guid>(); IEnumerable <CompanyGroupLimitation> limitations = new List <CompanyGroupLimitation>(); string creator = "lanlan"; bool expected = true; bool actual; actual = CompanyService.CreateCompanyGroup(ownerId, group, members, limitations, creator); Assert.AreEqual(expected, actual); }