There are no comments for Core in the schema.
Наследование: DataServiceContextBase
        public void AttachingDetachedEntitySucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(new Uri("http://localhost"));
            var entity = new Node();
            Mock.Arrange(() => svc.AttachTo(Arg.AnyString, Arg.AnyObject)).OccursOnce();

            // Act
            svc.AttachIfNeeded(entity);

            // Assert
            Mock.Assert(svc);
        }
        public void AttachingEntityToInvalidEntitySetThrowsException()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(new Uri("http://localhost"));
            var entity = new Node();
            var entitySetName = "InvalidEntitySetName";
            Mock.Arrange(() => svc.AttachTo(Arg.AnyString, Arg.AnyObject)).OccursOnce();

            // Act
            svc.AttachIfNeeded(entitySetName, entity);

            // Assert
            Mock.Assert(svc);
        }
        public void InvokeCoreNodeTemplateWithExecuteSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.Execute<Node>(_uriAction, "POST", true).Single();

            // Assert
            Assert.IsNotNull(result);
        }
        public void AttachingDetachedEntitySucceeds()
        {
            // Arrange
            var svc    = new biz.dfch.CS.Appclusive.Api.Core.Core(new Uri("http://localhost"));
            var entity = new Node();

            Mock.Arrange(() => svc.AttachTo(Arg.AnyString, Arg.AnyObject)).OccursOnce();

            // Act
            svc.AttachIfNeeded(entity);

            // Assert
            Mock.Assert(svc);
        }
        public void InvokeCoreNodeTemplateWithExecuteSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.Execute <Node>(_uriAction, "POST", true).Single();

            // Assert
            Assert.IsNotNull(result);
        }
        public void AttachingEntityToInvalidEntitySetThrowsException()
        {
            // Arrange
            var svc           = new biz.dfch.CS.Appclusive.Api.Core.Core(new Uri("http://localhost"));
            var entity        = new Node();
            var entitySetName = "InvalidEntitySetName";

            Mock.Arrange(() => svc.AttachTo(Arg.AnyString, Arg.AnyObject)).OccursOnce();

            // Act
            svc.AttachIfNeeded(entitySetName, entity);

            // Assert
            Mock.Assert(svc);
        }
        public void InvokeCoreNodeTemplateWithGenericHelperAndEntitySetNameSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult <Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeAvailableActionsWithNonGenericHelperAndEntityAndTypeSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntityActionWithListResult(new Node()
            {
                Id = CoreTest.nodeId
            }, "AvailableActions", typeof(string), null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeStatusWithNonGenericHelperAndEntityAndObjectSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntityActionWithSingleResult(new Node()
            {
                Id = CoreTest.nodeId
            }, "Status", new Job(), null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeTemplateWithAuthenticationBearerSucceeds()
        {
            //Test runs only if there is a file TestSettings.txt in the project folders containing the settings in the format
            //{key}={value}\n

            // Arrange
            TestSettings settings = TestSettings.Load();
            string       token    = settings.GetValue("AccessToken");
            var          svc      = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = new System.Net.NetworkCredential(biz.dfch.CS.Appclusive.Api.Core.Core.AuthorisationBaererUserName, token);

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult <Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeTemplateWithTenantIdSucceeds()
        {
            //Test runs only if there is a file TestSettings.txt in the project folders containing the settings in the format
            //{key}={value}\n

            // Arrange
            TestSettings settings = TestSettings.Load();
            string       username = settings.GetValue("Username");
            string       password = settings.GetValue("Password");
            string       tenantId = settings.GetValue("TenantId");
            var          svc      = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            svc.Credentials = new System.Net.NetworkCredential(username, password);
            svc.TenantID    = tenantId;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult <Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeTemplateWithTenantIdSucceeds()
        {
            //Test runs only if there is a file TestSettings.txt in the project folders containing the settings in the format
            //{key}={value}\n

            // Arrange
            TestSettings settings = TestSettings.Load();
            string username = settings.GetValue("Username");
            string password = settings.GetValue("Password");
            string tenantId = settings.GetValue("TenantId");
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = new System.Net.NetworkCredential(username, password);
            svc.TenantID = tenantId;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult<Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeTemplateWithAuthenticationBearerSucceeds()
        {
            //Test runs only if there is a file TestSettings.txt in the project folders containing the settings in the format
            //{key}={value}\n
           
            // Arrange
            TestSettings settings = TestSettings.Load();
            string token = settings.GetValue("AccessToken");
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = new System.Net.NetworkCredential(biz.dfch.CS.Appclusive.Api.Core.Core.AuthorisationBaererUserName, token);

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult<Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void RevertEntityStateWithModifiedStateSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            var node = svc.Nodes.First();
            node.Description = "arbitrary-changed-description-setting-the-entity-state-to-modified";

            // Act
            svc.RevertEntityState(node);

            // Assert
            Assert.IsFalse(svc.HasPendingChanges());
        }
        public void RevertEntityStateWithDeletedStateSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            var entity = svc.Nodes.First();
            svc.DeleteObject(entity);

            // Act
            svc.RevertEntityState(entity);

            // Assert
            Assert.IsFalse(svc.HasPendingChanges());
        }
        public void HasPendingChangesWithChangesReturnsTrue()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            var node = new Node();
            svc.AddToNodes(node);

            // Act
            var result = svc.HasPendingChanges();

            // Assert
            Assert.IsTrue(result);
        }
        public void RevertEntityStateWithAddedStateSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            var node = new Node();
            svc.AddToNodes(node);

            // Act
            svc.RevertEntityState(node);

            // Assert
            Assert.IsFalse(svc.HasPendingChanges());
        }
        public void InvokeCoreNodeTemplateWithGenericHelperAndEntitySetNameSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            var _uriAction = new Uri(_uriPrefix + "Core/Nodes/Template");

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult<Node>("Nodes", "Template", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void HasPendingChangesWithNoChangesReturnsFalse()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            // Act
            var result = svc.HasPendingChanges();

            // Assert
            Assert.IsFalse(result);
        }
        public void GetBodyOperationParametersFromObjectSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            var param1Value = "some arbitrary value";
            var param2Value = 42;
            var input = new BodyOperationTestClass()
            {
                Param1 = param1Value
                ,
                Param2 = param2Value
            };

            // Act
            var result = svc.GetBodyOperationParametersFromObject(input);

            // Assert
            Assert.AreEqual(3, result.Count());
            var p1 = result.Where(e => e.Name == "Param1").Single();
            Assert.AreEqual(param1Value, p1.Value);
            var p2 = result.Where(e => e.Name == "Param2").Single();
            Assert.AreEqual(param2Value, p2.Value);
            var p3 = result.Where(e => e.Name == "Field3").Single();
            Assert.AreEqual(FIELD3_VALUE, p3.Value);
        }
        public void GetBodyOperationParametersFromDictionarySucceeds()
        {
            // Arrange
            var param1Value = "some arbitrary value";
            var param2Value = 42;

            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);

            var input = new Dictionary<string, object>();
            input.Add("Param1", param1Value);
            input.Add("Param2", param2Value);
            input.Add("Field3", FIELD3_VALUE);

            // Act
            var result = svc.GetBodyOperationParametersFromDictionary(input);

            // Assert
            Assert.AreEqual(3, result.Count());
            var p1 = result.Where(e => e.Name == "Param1").Single();
            Assert.AreEqual(param1Value, p1.Value);
            var p2 = result.Where(e => e.Name == "Param2").Single();
            Assert.AreEqual(param2Value, p2.Value);
            var p3 = result.Where(e => e.Name == "Field3").Single();
            Assert.AreEqual(FIELD3_VALUE, p3.Value);
        }
        public void InvokeCoreNodeAvailableActionsWithNonGenericHelperAndEntityAndTypeSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntityActionWithListResult(new Node() { Id = CoreTest.nodeId }, "AvailableActions", typeof(string), null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeAvailableActionsWithNonGenericHelperAndEntitySetNameAndObjectSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntityActionWithListResult("Nodes", CoreTest.nodeId, "AvailableActions", "", null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeTemplateWithNonGenericHelperAndEntityAndTypeSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntitySetActionWithSingleResult(new Node(), "Template", typeof(Node), null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeStatusWithNonGenericHelperAndEntitySetNameAndTypeSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntityActionWithSingleResult("Nodes", CoreTest.nodeId, "Status", typeof(Job), null);

            // Assert
            Assert.IsNotNull(result);
        }
        public void InvokeCoreNodeStatusWithNonGenericHelperAndEntityAndObjectSucceeds()
        {
            // Arrange
            var svc = new biz.dfch.CS.Appclusive.Api.Core.Core(_uri);
            svc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

            // Act
            var result = svc.InvokeEntityActionWithSingleResult(new Node() { Id = CoreTest.nodeId }, "Status", new Job(), null);

            // Assert
            Assert.IsNotNull(result);
        }