public async Task Static_Test_SignUp() { using (var client = new TestClientProvider().Client) { try { var response = await client.PostAsync("/api/Security/SignUp", new StringContent(JsonConvert.SerializeObject(new AccountSecurity() { Name = GenerateName(), Email = emaillSignIn, Password = passwordSignIn, Phones = GeneratePhones(), }), Encoding.UTF8, "application/json")); response.EnsureSuccessStatusCode(); response.StatusCode.Should().Be(HttpStatusCode.OK); } catch (Exception e) { //implementation logger Console.WriteLine(e); } } }
public async Task Test_SignIn_BadRequest() { using (var client = new TestClientProvider().Client) { try { var response = await client.PostAsync("/api/Security/SignIn", new StringContent(JsonConvert.SerializeObject(new AccountSecurity() { Email = GenerateEmail(), Password = "******", }), Encoding.UTF8, "application/json")); response.StatusCode.Should().Be(HttpStatusCode.BadRequest); } catch (Exception e) { //implementation logger Console.WriteLine(e); } } }