public void ShouldPushTheActionOfEachSubcontrollerIntoViewdata()
        {
            var c1 = new SubController();
            var c2 = new SubController();

            var attribute = new SubControllerActionToViewDataAttribute();
            var controller = new TestingController();
            ActionExecutingContext context = GetFilterContext(controller);
            context.ActionParameters["c1"] = c1;
            context.ActionParameters["c2"] = c2;

            attribute.OnActionExecuting(context);

            Assert.That(controller.ViewData.Get<Action>("c1"), Is.Not.Null);
            Assert.That(controller.ViewData.Get<Action>("c2"), Is.Not.Null);
        }
Example #2
0
        public void Partitions_GetWithNoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.Partitions);
        }
Example #3
0
        public void MoveToAnotherSite_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.MoveToAnotherSite("siteName"));
        }
Example #4
0
        public void MoveToAnotherSite_NullSiteName_ThrowsArgumentNullException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentNullException>("siteName", () => controller.MoveToAnotherSite(null));
        }
Example #5
0
        public void IPAddress_GetWithNoContext_ThrowsArgumentNullException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentNullException>("hostNameOrAddress", () => controller.IPAddress);
        }
Example #6
0
        public void GetReplicationOperationInformation_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.GetReplicationOperationInformation());
        }
Example #7
0
        public void GetReplicationNeighbors_EmptyPartition_ThrowsArgumentException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentException>("partition", () => controller.GetReplicationNeighbors(string.Empty));
        }
Example #8
0
        public void GetReplicationMetadata_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.GetReplicationMetadata("objectPath"));
        }
        public void TriggerSyncReplicaFromNeighbors_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.TriggerSyncReplicaFromNeighbors("partition"));
        }
Example #10
0
        public void TransferRoleOwnership_InvalidRole_ThrowsInvalidEnumArgumentException(ActiveDirectoryRole role)
        {
            var controller = new SubController();

            AssertExtensions.Throws <InvalidEnumArgumentException>("role", () => controller.TransferRoleOwnership(role));
        }
Example #11
0
        public void TransferRoleOwnership_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.TransferRoleOwnership(ActiveDirectoryRole.NamingRole));
        }
Example #12
0
        public void SyncReplicaFromAllServers_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.SyncReplicaFromAllServers("partition", SyncFromAllServersOptions.AbortIfServerUnavailable));
        }
Example #13
0
        public void SyncReplicaFromAllServers_EmptyPartition_ThrowsArgumentException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentException>("partition", () => controller.SyncReplicaFromAllServers(string.Empty, SyncFromAllServersOptions.AbortIfServerUnavailable));
        }
Example #14
0
        public void SyncReplicaFromServer_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.SyncReplicaFromServer("partition", "sourceServer"));
        }
Example #15
0
        public void SyncReplicaFromServer_EmptySourceServer_ThrowsArgumentException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentException>("sourceServer", () => controller.SyncReplicaFromServer("partition", string.Empty));
        }
Example #16
0
        public void GetReplicationMetadata_EmptyObjectPath_ThrowsArgumentException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentException>("objectPath", () => controller.GetReplicationMetadata(string.Empty));
        }
Example #17
0
 void Start()
 {
     sb = GameObject.Find("Submarine").GetComponent <SubController>();
 }
Example #18
0
        public void GetReplicationNeighbors_NullPartition_ThrowsArgumentNullException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentNullException>("partition", () => controller.GetReplicationNeighbors(null));
        }
Example #19
0
        public void CheckReplicationConsistency_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.CheckReplicationConsistency());
        }
Example #20
0
        public void GetReplicationNeighbors_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.GetReplicationNeighbors("partition"));
        }
Example #21
0
        public void CurrentTime_GetWithNoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.CurrentTime);
        }
Example #22
0
        public void HighestCommittedUsn_GetWithNoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.HighestCommittedUsn);
        }
Example #23
0
        public void Forest_GetWithNoContext_ThrowsActiveDirectoryObjectNotFoundException()
        {
            var controller = new SubController();

            Assert.Throws <ActiveDirectoryObjectNotFoundException>(() => controller.Forest);
        }
Example #24
0
        public void IsGlobalCatalog_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.IsGlobalCatalog());
        }
Example #25
0
        public void EnableGlobalCatalog_NoContext_ThrowsActiveDirectoryObjectNotFoundException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.EnableGlobalCatalog());
        }
Example #26
0
        public void MoveToAnotherSite_EmptySiteName_ThrowsArgumentException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentException>("siteName", () => controller.MoveToAnotherSite(string.Empty));
        }
Example #27
0
        public void GetDirectorySearcher_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.GetDirectorySearcher());
        }
Example #28
0
        public void OSVersion_GetWithNoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.OSVersion);
        }
Example #29
0
        public void GetReplicationConnectionFailures_NoContext_ThrowsNullReferenceException()
        {
            var controller = new SubController();

            Assert.Throws <NullReferenceException>(() => controller.GetReplicationConnectionFailures());
        }
Example #30
0
        public void GetReplicationMetadata_NullObjectPath_ThrowsArgumentNullException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentNullException>("objectPath", () => controller.GetReplicationMetadata(null));
        }
Example #31
0
        public void SyncReplicaFromServer_NullSourceServer_ThrowsArgumentNullException()
        {
            var controller = new SubController();

            AssertExtensions.Throws <ArgumentNullException>("sourceServer", () => controller.SyncReplicaFromServer("partition", null));
        }