Beispiel #1
0
        public void CanANewRoleBeCreated()
        {
            Role a = new Role()
            {
                roleid      = 99,
                title       = "some text that came from testing",
                permissions = new List <RolePermissions>(),
            };

            a.permissions.Add(new RolePermissions()
            {
                keyid = "Some Role Name",
                value = "Some value to the role name"
            }
                              );
            a.permissions.Add(new RolePermissions()
            {
                keyid = "Some other Role Name",
                value = "Some other value to the role name"
            }
                              );

            _testRepo.Add(a);

            var insertedRole = _testRepo.FindAll().Where(w => w.title == a.title).First();

            _testid = insertedRole.roleid;
            Assert.AreEqual(a.title, insertedRole.title);
        }
Beispiel #2
0
 public IActionResult GetRole()
 {
     _log.LogInformation(RoleRepo.getConnectionString());
     return(Ok(RoleRepo.FindAll()));
 }