Esempio n. 1
0
        public void CheckUser_DoNotPass()
        {
            ServiceUserRepository serviceUserRepository = this.CreateServiceUserRepository();

            var res = serviceUserRepository.CheckUser(Path.GetRandomFileName(), "B");

            Assert.IsFalse(res);
        }
Esempio n. 2
0
        public void CheckUser_Pass()
        {
            ServiceUserRepository serviceUserRepository = this.CreateServiceUserRepository();
            string username     = Path.GetRandomFileName();
            var    serviceUsers = subMongoDatabase.GetCollection <ServiceUser>(nameof(ServiceUser));

            serviceUsers.InsertOne(new ServiceUser {
                Username = username, Password = "******"
            });

            var res = serviceUserRepository.CheckUser(username, "B");

            Assert.IsTrue(res);
        }