예제 #1
0
        public void should_retrieve_existing_user()
        {
            User savedUser;

            using (var context = new DigitalHiveContext(_options))
            {
                var repository = new Respository(context);

                User user = new User()
                {
                    Username = "******",
                    Password = "******",
                    Role     = "Manager"
                };

                savedUser = repository.RegisterUser(user);
            }

            using (var context = new DigitalHiveContext(_options))
            {
                var repository = new Respository(context);
                var result     = repository.GetUser("existinguser");
                Assert.AreEqual(result.ID, savedUser.ID, "Users do not match as expected");
            }
        }
예제 #2
0
        public void should_register_user()
        {
            using (var context = new DigitalHiveContext(_options))
            {
                var repository = new Respository(context);

                User user = new User()
                {
                    Username = "******",
                    Password = "******",
                    Role     = "Manager"
                };

                var result = repository.RegisterUser(user);

                Assert.That(result.ID != 0, "Expected a new ID to be returned for user");
            }
        }