Exemple #1
0
        public void DeleteAppUserByNameTrue()
        {
            IAppUserService service  = new AppUserService();
            const string    userName = "******";

            bool creationBool        = service.CreateAppUser(userName, Password, Salt);
            bool existBeforeDeletion = service.AppUserExist(userName);
            bool deletionBool        = service.DeleteAppUser(userName);

            Assert.True(creationBool);
            Assert.True(existBeforeDeletion);
            Assert.True(deletionBool);
            Assert.False(service.AppUserExist(userName));
        }
Exemple #2
0
        public void AppUserExistByNameTrue()
        {
            IAppUserService service  = new AppUserService();
            const string    userName = "******"; //Hardcoded user in DB //todo replace with a mock

            Assert.True(service.AppUserExist(userName));
        }
Exemple #3
0
        public void AppUserExistByNameFalse()
        {
            IAppUserService service  = new AppUserService();
            const string    userName = "******"; //Hardcoded user in DB //todo replace with a mock

            Assert.False(service.AppUserExist(userName));
        }
Exemple #4
0
        public void AppUserExistByIdTrue()
        {
            IAppUserService service = new AppUserService();
            const int       userId  = 0; //Hardcoded user in DB //todo replace with a mock

            Assert.True(service.AppUserExist(userId));
        }
Exemple #5
0
        public void DeleteAppUserByNameFalse()
        {
            IAppUserService service   = new AppUserService();
            const string    userName  = "******";
            const string    falseName = "not docker";

            bool creationBool        = service.CreateAppUser(userName, Password, Salt);
            bool existBeforeDeletion = service.AppUserExist(userName);
            bool deletionBool        = service.DeleteAppUser(falseName);

            Assert.True(creationBool);
            Assert.True(existBeforeDeletion);
            Assert.False(deletionBool);
            Assert.True(service.AppUserExist(userName));

            //clean up todo delete when mock is working
            service.DeleteAppUser(userName);
        }
Exemple #6
0
        public void DeleteAppUserByIdFalse()
        {
            IAppUserService service  = new AppUserService();
            const string    userName = "******";
            const int       falseId  = -2;

            bool creationBool        = service.CreateAppUser(userName, Password, Salt);
            int  userId              = service.GetAppUserId(userName);
            bool existBeforeDeletion = service.AppUserExist(userId);
            bool deletionBool        = service.DeleteAppUser(falseId);

            Assert.True(creationBool);
            Assert.True(existBeforeDeletion);
            Assert.False(deletionBool);
            Assert.True(service.AppUserExist(userName));
            Assert.True(service.AppUserExist(userId));

            //clean up todo delete when mock is working
            service.DeleteAppUser(userName);
        }