示例#1
0
        /// <summary>
        /// Process the projection asynchronously and return the end state of the projection
        /// </summary>
        /// <param name="projectionToProcess">
        /// The projection to run
        /// </param>
        /// <returns>
        /// The sequence number up until which the projection was run
        /// </returns>
        public async Task <IProjectionResponse> ProcessAsync(IProjectionUntyped projectionToProcess,
                                                             OrchestrationCallbackIdentity responseSource = null)
        {
            await  Process(projectionToProcess);

            return(ProjectionResponse.Create(projectionToProcess, responseSource));
        }
        public void CreateFromPath_ValidPath_Domain_TestMethod()
        {
            string TestPath = "Domain/Query/The-Query/{1234-1234-12345678}";

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            Assert.IsNotNull(testIdentity);
        }
        public void CreateFromPath_InvalidPath_TooShort_TestMethod()
        {
            string TestPath = "The/Command";

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            Assert.IsNull(testIdentity);
        }
        public void CreateFromPath_InvalidPath_TooLong_TestMethod()
        {
            string TestPath = "The/Command/I-have/selected/has-too/long/a-path";

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            Assert.IsNull(testIdentity);
        }
        public void CreateFromPath_NullPath_TestMethod()
        {
            string TestPath = null;

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            Assert.IsNull(testIdentity);
        }
        public void ClassificationFromString_query_TestMethod()
        {
            OrchestrationClassifications expected = OrchestrationClassifications.Query;
            OrchestrationClassifications actual   = OrchestrationClassifications.NotSet;

            actual = OrchestrationCallbackIdentity.ClassificationFromString("query");

            Assert.AreEqual(expected, actual);
        }
        public void ClassificationFromString_command_TestMethod()
        {
            OrchestrationClassifications expected = OrchestrationClassifications.Command;
            OrchestrationClassifications actual   = OrchestrationClassifications.NotSet;

            actual = OrchestrationCallbackIdentity.ClassificationFromString("command");

            Assert.AreEqual(expected, actual);
        }
        public void ClassificationFromString_Null_TestMethod()
        {
            OrchestrationClassifications expected = OrchestrationClassifications.NotSet;
            OrchestrationClassifications actual   = OrchestrationClassifications.Projection;

            actual = OrchestrationCallbackIdentity.ClassificationFromString(null);

            Assert.AreEqual(expected, actual);
        }
        public void ClassificationFromString_group_TestMethod()
        {
            OrchestrationClassifications expected = OrchestrationClassifications.IdentifierGroup;
            OrchestrationClassifications actual   = OrchestrationClassifications.NotSet;

            actual = OrchestrationCallbackIdentity.ClassificationFromString("group");

            Assert.AreEqual(expected, actual);
        }
        public void ClassificationFromString_CLASSIFIER_TestMethod()
        {
            OrchestrationClassifications expected = OrchestrationClassifications.Classifier;
            OrchestrationClassifications actual   = OrchestrationClassifications.NotSet;

            actual = OrchestrationCallbackIdentity.ClassificationFromString("CLASSIFIER");

            Assert.AreEqual(expected, actual);
        }
        public void CreateFromPath_ValidPath_Domain_Identity_TestMethod()
        {
            Guid expected = new Guid("02d96365-0fbe-43e6-9517-e7c22427bde7");
            Guid actual   = Guid.Empty;

            string TestPath = "Domain/Query/The-Query/02d96365-0fbe-43e6-9517-e7c22427bde7";

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            actual = testIdentity.InstanceIdentity;

            Assert.AreEqual(expected, actual);
        }
        public void CreateFromPath_ValidPath_Domain_QueryType_TestMethod()
        {
            string TestPath = "Domain/Query/The-Query/{1234-1234-12345678}";

            OrchestrationClassifications expected = OrchestrationClassifications.Query;
            OrchestrationClassifications actual   = OrchestrationClassifications.NotSet;

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            actual = testIdentity.Classification;

            Assert.AreEqual(expected, actual);
        }
        public void CreateFromPath_ValidPath_Domain_QueryName_TestMethod()
        {
            string TestPath = "Domain/Query/The-Query/{1234-1234-12345678}";

            string expected = "The-Query";
            string actual   = "Not set";

            OrchestrationCallbackIdentity testIdentity = OrchestrationCallbackIdentity.CreateFromPath(TestPath);

            actual = testIdentity.InstanceName;

            Assert.AreEqual(expected, actual);
        }