public void ExceptionTestFor_UserNotFound() { //Arrange Buyer buyer = new Buyer() { BuyerId = 1, BuyerName = "John", Email = "*****@*****.**", Password = "******", MobileNumber = 9876543210 }; Seller seller = new Seller() { SellerId = 10, SellerName = "Mary", Email = "*****@*****.**", Password = "******", PostelAdress = "Delhi", GSTIN = "ABVC123XY763BG5", BankDetails = "SBI" }; //Action //Assert var ex = Assert.Throws <UserNotFoundException>(() => _Buyerservice.Login(buyer.Email, buyer.Password)); var exc = Assert.Throws <UserNotFoundException>(() => _Sellerservice.Login(seller.Email, seller.Password)); Assert.Equal("User Not Found in User List", ex.Messages); Assert.Equal("User Not Found in User List", exc.Messages); }
public void Test_For_Valid_Login() { //Arrange Buyer buyer = new Buyer() { BuyerId = 1, BuyerName = "John", Email = "*****@*****.**", Password = "******", MobileNumber = 9876543210 }; Seller seller = new Seller() { SellerId = 10, SellerName = "Mary", Email = "*****@*****.**", Password = "******", PostelAdress = "Delhi", GSTIN = "ABVC123XY763BG5", BankDetails = "SBI" }; //Action var IsLoggedBuyer = _Buyerservice.Login(buyer.BuyerName, buyer.Password); var IsLoggedSeller = _Sellerservice.Login(seller.SellerName, seller.Password); //Assert Assert.True(IsLoggedBuyer); Assert.True(IsLoggedSeller); }