Template
42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace Strata.ContinuousImprovement.Api.Test.Integration.Tests
|
|
{
|
|
[ExcludeFromCodeCoverage]
|
|
[TestFixture(Category = "Integration")]
|
|
public class TestUsersController : ApiTestBase
|
|
{
|
|
protected const string UsersEndpoint = "api/v1/users";
|
|
|
|
[TestCaseSource(nameof(TestUserCases))]
|
|
public async Task TestUsers(string testName, string url, bool hasCostLeader, bool hasAaronHooper)
|
|
{
|
|
// arrange
|
|
var request = new HttpRequestMessage(HttpMethod.Get, UsersEndpoint + $"/{url}");
|
|
|
|
// act
|
|
var response = await HttpClient.SendAsync(request);
|
|
response.EnsureSuccessStatusCode();
|
|
|
|
// assert
|
|
Assert.Multiple(() =>
|
|
{
|
|
response.AssertIsValid();
|
|
});
|
|
}
|
|
|
|
public static IEnumerable<TestCaseData> TestUserCases()
|
|
{
|
|
yield return new TestCaseData("administrators", "administrators", true, false)
|
|
.SetName("{m} - {0}");
|
|
yield return new TestCaseData("cost leaders", "cost-leaders", true, false)
|
|
.SetName("{m} - {0}");
|
|
yield return new TestCaseData("executive sponsors", "executive-sponsors", true, false)
|
|
.SetName("{m} - {0}");
|
|
yield return new TestCaseData("owners", "owners", true, true)
|
|
.SetName("{m} - {0}");
|
|
yield return new TestCaseData("users", "users", true, true)
|
|
.SetName("{m} - {0}");
|
|
}
|
|
}
|
|
} |