Exemplo n.º 1
0
 public void Setup()
 {
     //arrange
     factory    = new AuthZFactory();
     adminAuthZ = new bool[2] {
         true, true
     };
     householdID = 1234;
     displayName = "ExampleName";
     attributes  = factory.CreateCoHostAuthZ(displayName, householdID, adminAuthZ);
 }
Exemplo n.º 2
0
        public void CreateAuthZ_CoHost_Test1()
        {
            //Arrange
            var displayName = "Example Name";
            var householdID = 1234;
            var actual      = invoker.CreateAuthZ(displayName, householdID, AuthZInvoker.AuthRole.cohost, AuthZInvoker.AuthAdmin.nonadmin);
            var authAdmin   = invoker.GetAdminAuthZ(AuthZInvoker.AuthAdmin.nonadmin);
            var expected    = factory.CreateCoHostAuthZ(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);
        }