Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }