public void CantEditMembershipRole() { using (EF_ZMT_DbContext.EF_ZMT_DbContext context = new EF_ZMT_DbContext.EF_ZMT_DbContext()) { context.Context.ExecuteStoreCommand("DELETE FROM MembershipRole"); FixedAssetService transaction = new FixedAssetService(); MembershipRole role = new MembershipRole() { name = "Admins" }; transaction.EditMembershipRole(role); } }
public void CanEditMembershipRole() { using (EF_ZMT_DbContext.EF_ZMT_DbContext context = new EF_ZMT_DbContext.EF_ZMT_DbContext()) { context.Context.ExecuteStoreCommand("DELETE FROM MembershipRole"); FixedAssetService transaction = new FixedAssetService(); MembershipRole role = new MembershipRole() { name = "Admins" }; transaction.AddMembershipRole(role); Assert.AreEqual(context.Context.MembershipRoles.Count(), 1); role = context.Context.MembershipRoles.FirstOrDefault(x => x.name == "Admins"); role.name = "Users"; transaction.EditMembershipRole(role); role = context.Context.MembershipRoles.FirstOrDefault(x => x.name == "Users"); Assert.IsNotNull(role); Assert.AreEqual(context.Context.MembershipRoles.Count(), 1); } }