public async Task SecurityServiceManager_GetUserByUserId_UserNotFound_ErrorThrown() { TestScenario testScenario = TestScenario.GetUserByUserIdUserNotFound; SecurityServiceManager securityServiceManager = this.SetupSecurityServiceManager(testScenario); Should.Throw <NotFoundException>(async() => { await securityServiceManager.GetUserByUserId(Guid.Parse(SecurityServiceManagerTestData.User1Id), CancellationToken.None); }); }
public async Task SecurityServiceManager_GetUserByUserId_InvalidData_ErrorThrown() { TestScenario testScenario = TestScenario.GetUserByUserIdInvalidId; SecurityServiceManager securityServiceManager = this.SetupSecurityServiceManager(testScenario); Should.Throw <ArgumentNullException>(async() => { await securityServiceManager.GetUserByUserId(Guid.Empty, CancellationToken.None); }); }
public async Task SecurityServiceManager_GetUserByUserId_UserDataReturned() { TestScenario testScenario = TestScenario.GetUserByUserIdSuccess; SecurityServiceManager securityServiceManager = this.SetupSecurityServiceManager(testScenario); GetUserResponse response = await securityServiceManager.GetUserByUserId(Guid.Parse(SecurityServiceManagerTestData.User1Id), CancellationToken.None); response.UserId.ShouldBe(Guid.Parse(SecurityServiceManagerTestData.User1Id)); response.UserName.ShouldBe(SecurityServiceManagerTestData.UserName); response.Claims.ShouldNotBeEmpty(); response.Email.ShouldBe(SecurityServiceManagerTestData.EmailAddress); response.PhoneNumber.ShouldBe(SecurityServiceManagerTestData.PhoneNumber); response.Roles.ShouldBe(SecurityServiceManagerTestData.Roles); }