public async Task <bool> UpGradeMemberShip(int id, MemberShip memberShip) { if (id != memberShip.MembershipId) { throw new ArgumentException("id miss match"); } // memberShip.MembershipId = id; await memberShipRepository.UpGradeMemberShip(memberShip); return(true); }
public async Task UpGradeMemberShip() { try { MemberShip memberShip = new MemberShip { MembershipId = 1, Name = "Test", Email = "*****@*****.**", ActiveDate = DateTime.Now, DeactiveDate = DateTime.Now.AddMonths(1), IsActive = true }; var result = await memberShipRepository.UpGradeMemberShip(memberShip); Assert.True(result == true, "The Data updated Successfully !!"); Assert.False( result == false, "updation failed."); } catch (Exception ex) { Assert.NotNull(ex); Assert.IsType <InvalidOperationException>(ex); } }