Esempio n. 1
0
        public void TestSelectByID()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            List <User> result = tester.getUserByID(5);

            Assert.IsNotNull(result, "Seharusnya not null");
        }
Esempio n. 2
0
        public void TestSelectByNameorEmail()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            User result = tester.getUserByNameOrEmail("ali", "*****@*****.**");

            Assert.IsNotNull(result, "Seharusnya not null");
        }
Esempio n. 3
0
        public void TestSelectMaxID()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            int result   = tester.getMaxId();
            int expected = 3;

            Assert.AreEqual(result, expected, "Seharusnya 3");
        }
Esempio n. 4
0
        public void TestSelectByEmail()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            List <User> result = tester.getUserByEmail("asd");

            Assert.IsFalse(result.Any(), "harusnya false");
            //Assert.IsNotNull(result, "Seharusnya not null");
        }
Esempio n. 5
0
        public void TestSelectByName()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            List <User> result   = tester.getUserByName("ali");
            String      expected = "ali";
            User        testing  = result.FirstOrDefault();

            Assert.AreEqual(expected, testing.Name, "Seharusnya ali");
        }
Esempio n. 6
0
        public void TestSelectAllItem()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            List <User> result   = tester.getAllUserTest();
            int         expected = 3;
            int         a        = result.Count;

            Assert.AreEqual(expected, a, "Seharusnya 3");
        }
Esempio n. 7
0
        public void TestDeleteUserbyId()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            tester.deleteUserById(3);
            int         expected = 2;
            List <User> result   = tester.getAllUserTest();
            int         a        = result.Count;

            Assert.AreEqual(expected, a, "Seharusnya 2");
        }
Esempio n. 8
0
        public void TestAddNewUser()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            tester.addNewUser("adi", "*****@*****.**", "12345");
            int         expected = 4;
            List <User> result   = tester.getAllUserTest();
            int         a        = result.Count;

            Assert.AreEqual(expected, a, "Seharusnya 4");
        }
Esempio n. 9
0
        public void TestChangePassword()
        {
            MockUser tester = new MockUser();

            tester.createMockUser();
            tester.changePassword("123456789", 3);
            string      expected = "123456789";
            List <User> result   = tester.getUserByID(3);
            string      a        = result.FirstOrDefault().Password;

            Assert.AreEqual(expected, a, "Seharusnya sama");
        }