Vowzss
Vowzss
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
o yeah thank you! will do
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
still the same issue with it :/ I have no clue what I am doing wrong
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
following the provided exemple
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
public class EtherIntegrationTests(WebApplicationFactory<EtherEntryPoint> factory)
: IClassFixture<WebApplicationFactory<EtherEntryPoint>>
{
[Theory]
[InlineData("/api/v1/auth/signup")]
public async Task Test_SignUp(string url)
{
var client = factory.CreateClient();
var payload = new SignUpRequestPayload
{
Username = "e",
Email = "[email protected]",
Password = "e#20515"
};

var content = new StringContent(JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var responseString = await response.Content.ReadAsStringAsync();

Console.WriteLine(responseString);
}
}
public class EtherIntegrationTests(WebApplicationFactory<EtherEntryPoint> factory)
: IClassFixture<WebApplicationFactory<EtherEntryPoint>>
{
[Theory]
[InlineData("/api/v1/auth/signup")]
public async Task Test_SignUp(string url)
{
var client = factory.CreateClient();
var payload = new SignUpRequestPayload
{
Username = "e",
Email = "[email protected]",
Password = "e#20515"
};

var content = new StringContent(JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var responseString = await response.Content.ReadAsStringAsync();

Console.WriteLine(responseString);
}
}
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
atm I just want something that works xD
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
IClassFixture is from XUnit right ?
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
my bad
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
No description
19 replies
CC#
Created by Vowzss on 10/11/2024 in #help
NUnit test with Asp net web API
No description
19 replies