Exemple #1
0
        public void TestLoginEmployeeMissingUserAndPass()
        {
            //Arrange
            string username = "";
            string pass     = "";
            bool   verified = false;

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //act
                verified = proxy.LogOn(username, pass);
            }
            //assert
            Assert.IsFalse(verified);
        }
Exemple #2
0
        public void TestLoginCustomerMissingEmailAndPass()
        {
            //Arrange
            string   username = "";
            string   pass     = "";
            Customer customer = new Customer();;

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //Act
                customer = proxy.LoginCustomer(username, pass);
            }
            //Assert
            Assert.IsNull(customer);
        }
Exemple #3
0
        public void TestLoginCustomerMissingPass()
        {
            //arrenge
            string   email    = "*****@*****.**";
            string   pass     = "";
            Customer customer = new Customer();

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //act
                customer = proxy.LoginCustomer(email, pass);
            }
            //assert
            Assert.IsNull(customer);
        }
Exemple #4
0
        public void TestLoginCustomerMissingEmail()
        {
            //arrenge
            string   email    = "";
            string   pass     = "******";
            Customer customer = new Customer();

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //act
                customer = proxy.LoginCustomer(email, pass);
            }
            //assert
            Assert.IsNull(customer);
        }
Exemple #5
0
        public void TestLoginEmployeeSuccesful()
        {
            //arrange
            string username = "******";
            string pass     = "******";
            bool   verified = false;

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //act
                verified = proxy.LogOn(username, pass);
            }
            //assert
            Assert.IsTrue(verified);
        }
Exemple #6
0
        public void TestInsertCustomerSucces()
        {
            Customer c = new Customer();

            c.Email    = "*****@*****.**"; //If it fails try another mail
            c.Password = "******";
            c.FName    = "Jeppe";
            c.LName    = "Larsen";
            c.PhoneNo  = "45454545";

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                c = proxy.InsertCustomer(c);
            }
            Assert.IsNotNull(c);
        }
Exemple #7
0
        public void TestInsertResWithNoSeats()
        {
            //Arrange
            Reservation res = new Reservation();

            res.Seats      = new List <Seat>();
            res.MovieId    = 1;
            res.CustomerId = 1;
            bool verified = false;

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //Act
                verified = proxy.InsertReservation(res);
            }
            //Assert
            Assert.IsFalse(verified);
        }
Exemple #8
0
        public void TestInsertResSuccess()
        {
            //Arrange
            Reservation res = new Reservation();

            res.Seats      = new List <Seat>();
            res.MovieId    = 1;
            res.CustomerId = 1;
            Seat s = new Seat();

            s.SeatId = 56; //Open the program and choose a free seat before running the test
            res.Seats.Add(s);
            bool verified = false;

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //Act
                verified = proxy.InsertReservation(res);
            }
            //Assert
            Assert.IsTrue(verified);
        }
Exemple #9
0
        public void TestInsertResWithBookedSeat()
        {
            //Arrange
            Reservation res = new Reservation();

            res.Seats      = new List <Seat>();
            res.MovieId    = 1;
            res.CustomerId = 1;
            Seat s = new Seat();

            s.SeatId = 1;
            res.Seats.Add(s);
            bool verified = false;

            using (PersonService.PersonServiceClient proxy = new PersonService.PersonServiceClient())
            {
                //Act
                verified = proxy.InsertReservation(res);
            }
            //Assert
            Debug.WriteLine("verified: " + verified);
            Assert.IsFalse(verified);
        }