public void TestRemoveNonExistingUser_GetRemoveUserNoUserFoundResponse(string id) { const int dataCount = 5; var expectedType = typeof(RemoveUserNoUserFoundResponse); //given a db with some users var dummyData = _testUtilitiesImpl.CreateUserDummyData(_signUpService, dataCount); //when we try to remove a user with non existing user id (mark as removed) var request = new RemoveUserRequest() { UserId = id }; var result = _removeUserService.RemoveUser(request); //then we get RemoveUserNoUserFoundResponse Assert.That(result, Is.TypeOf(expectedType)); _testUtilitiesImpl.DestroyUserDummyData(dummyData.ToArray()); }
public void TestSignUpWithValidUsernameAndEmail(string email, string username) { var expectedType = typeof(SignUpResponseOk); const int dataCount = 5; //given a database with some data var dummyData = _testUtilitiesImpl.CreateUserDummyData(_signUpService, dataCount); //when we try to signup new user with valid data (not existing in db) var login = new LoginDto { Email = email, Username = username }; var request = new SignUpRequest { Login = login }; var result = _signUpService.SignUp(request); //we get SignUpResponseOk Assert.That(result, Is.TypeOf(expectedType)); dummyData.Add(email); _testUtilitiesImpl.DestroyUserDummyData(dummyData.ToArray()); }
public void TestSignInWithExistingUserAndGetResponseOk() { var dataCount = 5; var random = new Random(); var expectedType = typeof(SignInResponseOK); //given a database with at least dataCount records var dummyData = _testUtilitiesImpl.CreateUserDummyData(_signUpService, dataCount); //when we login with an existing id var request = new SignInRequest(); var login = new LoginDto { Email = dummyData[random.Next(dataCount)] }; request.LoginDto = login; var response = _signInService.SignIn(request); //then we get SignInResponseOK Assert.That(response, Is.TypeOf(expectedType)); _testUtilitiesImpl.DestroyUserDummyData(dummyData.ToArray()); }
public void FinalTearDown() { _testUtilitiesImpl.DestroyUserDummyData(_createdUsers.ToArray()); }
public void FinalTearDown() { _testUtilitiesImpl.DestroyUserDummyData(_createdUsers.ToArray()); _testUtilitiesImpl.DeleteDocumentDummyData(_createdDocuments, _documentService); }