public void Setup() { //arrange factory = new AuthZFactory(); adminAuthZ = new bool[2] { true, true }; householdID = 1234; displayName = "ExampleName"; attributes = factory.CreateTenantAuthZ(displayName, householdID, adminAuthZ); }
public void CreateAuthZ_Tenant_Test1() { //Arrange var displayName = "Example Name"; var householdID = 1234; var actual = invoker.CreateAuthZ(displayName, householdID, AuthZInvoker.AuthRole.tenant, AuthZInvoker.AuthAdmin.nonadmin); var authAdmin = invoker.GetAdminAuthZ(AuthZInvoker.AuthAdmin.nonadmin); var expected = factory.CreateTenantAuthZ(displayName, householdID, authAdmin); //Assert Assert.AreEqual(expected.DisplayName, actual.DisplayName); Assert.AreEqual(expected.HouseholdID, actual.HouseholdID); AssertAuthorizations(expected.EnabledAuthZ, actual.EnabledAuthZ); AssertAuthorizations(expected.AdminAuthZ, actual.AdminAuthZ); AssertAuthorizations(expected.AccountAuthZ, actual.AccountAuthZ); AssertAuthorizations(expected.SearchHouseholdAuthZ, actual.SearchHouseholdAuthZ); AssertAuthorizations(expected.MessageAuthZ, actual.MessageAuthZ); AssertAuthorizations(expected.InviteAuthZ, actual.InviteAuthZ); AssertAuthorizations(expected.HouseholdAuthZ, actual.HouseholdAuthZ); AssertAuthorizations(expected.TenantAuthZ, actual.TenantAuthZ); AssertAuthorizations(expected.ExpenseAuthZ, actual.ExpenseAuthZ); AssertAuthorizations(expected.TaskAuthZ, actual.TaskAuthZ); AssertAuthorizations(expected.SRequestAuthZ, actual.SRequestAuthZ); }