public async Task GetRoleOrDefaultAsync_ReturnsNullWhenNoMatchingRoleName()
        {
            using (var databaseWrapper = new DatabaseWrapper())
            {
                var dataAccess = new UpdateCompetentAuthorityUserRoleAndStatusDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetRoleOrDefaultAsync("Invalid Role name");

                Assert.Null(result);
            }
        }
Пример #2
0
        public async Task GetRoleOrDefaultAsync_ReturnsNullWhenNoMatchingRoleName()
        {
            using (var databaseWrapper = new DatabaseWrapper())
            {
                var dataAccess = new UpdateCompetentAuthorityUserRoleAndStatusDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetRoleOrDefaultAsync("Invalid Role name");

                Assert.Null(result);
            }
        }
        public async Task GetRoleOrDefaultAsync_ReturnsMatchingRoleName()
        {
            using (var databaseWrapper = new DatabaseWrapper())
            {
                var dataAccess = new UpdateCompetentAuthorityUserRoleAndStatusDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetRoleOrDefaultAsync("InternalAdmin");

                Assert.NotNull(result);
                Assert.Equal("InternalAdmin", result.Name);
            }
        }
Пример #4
0
        public async Task GetRoleOrDefaultAsync_ReturnsMatchingRoleName()
        {
            using (var databaseWrapper = new DatabaseWrapper())
            {
                var dataAccess = new UpdateCompetentAuthorityUserRoleAndStatusDataAccess(databaseWrapper.WeeeContext);

                var result = await dataAccess.GetRoleOrDefaultAsync("InternalAdmin");

                Assert.NotNull(result);
                Assert.Equal("InternalAdmin", result.Name);
            }
        }