Example #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));
        }
Example #2
0
        public void GetValuesAsArray_NotNull_TestMethod()
        {
            ProjectionResponse projResp  = ProjectionResponse.Create(Mocking.Mocking.GetProjectionUntyped());
            JArray             testArray = projResp.Values;

            Assert.IsNotNull(testArray);
        }
Example #3
0
        public void GetValuesAsArray_AccountMatch_TestMethod()
        {
            string expected = "Acct.1";
            string actual   = "Not set";

            ProjectionResponse projResp  = ProjectionResponse.Create(Mocking.Mocking.GetProjectionUntyped());
            JArray             testArray = projResp.Values;

            Mocking.Mocking.MockBalanceResponse testItem = testArray.First.ToObject <Mocking.Mocking.MockBalanceResponse>();
            if (null != testItem)
            {
                actual = testItem.AccountNumber;
            }

            Assert.AreEqual(expected, actual);
        }
Example #4
0
        public void GetValuesAsArray_ValueMatch_TestMethod()
        {
            decimal expected = 70.0M;
            decimal actual   = -1.9M;

            ProjectionResponse projResp  = ProjectionResponse.Create(Mocking.Mocking.GetProjectionUntyped());
            JArray             testArray = projResp.Values;

            Mocking.Mocking.MockBalanceResponse testItem = testArray.First.ToObject <Mocking.Mocking.MockBalanceResponse>();
            if (null != testItem)
            {
                actual = testItem.Balance;
            }

            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void Constructor_TestMethod()
        {
            ProjectionResponse testObj = ProjectionResponse.Create(Mocking.Mocking.GetProjectionUntyped());

            Assert.IsNotNull(testObj);
        }