コード例 #1
0
        public void SeizeRoleOwnership_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.SeizeRoleOwnership(ActiveDirectoryRole.InfrastructureRole));
            Assert.Throws <NullReferenceException>(() => controller.SeizeRoleOwnership(ActiveDirectoryRole.NamingRole));
            Assert.Throws <NullReferenceException>(() => controller.SeizeRoleOwnership(ActiveDirectoryRole.PdcRole));
            Assert.Throws <NullReferenceException>(() => controller.SeizeRoleOwnership(ActiveDirectoryRole.RidRole));
            Assert.Throws <NullReferenceException>(() => controller.SeizeRoleOwnership(ActiveDirectoryRole.SchemaRole));
        }
コード例 #2
0
        public void SeizeRoleOwnership_InvalidRole_ThrowsInvalidEnumArgumentException(ActiveDirectoryRole role)
        {
            var controller = new SubController();

            AssertExtensions.Throws <InvalidEnumArgumentException>("role", () => controller.SeizeRoleOwnership(role));
        }