Ejemplo n.º 1
0
        public async Task Invalidate_request_when_no_user_found_by_sub(string sub)
        {
            // Arrange
            var sut = new GetAdministeredGroupsValidator(_dbContext);

            // Act
            bool isValid = await sut.IsValidAsync(new GetAdministeredGroups(sub));

            // Assert
            isValid.ShouldBeFalse();
        }
Ejemplo n.º 2
0
        public async Task Validate_when_user_was_found_by_sub()
        {
            // Arrange
            var sut = new GetAdministeredGroupsValidator(_dbContext);

            string userSub = Guid.NewGuid().ToString();
            await _dbContext.Users.AddAsync(new User
            {
                FirstName = "Integration",
                LastName  = "Test",
                Sub       = userSub
            });

            await _dbContext.SaveChangesAsync();

            // Act
            bool isValid = await sut.IsValidAsync(new GetAdministeredGroups(userSub));

            // Assert
            isValid.ShouldBeTrue();
        }