public void Constructor_TestMethod()
        {
            TableEventStreamReader testObj = new TableEventStreamReader(
                new EventStreamAttribute("Domain Test", "Entity Type Test", "Instance 123"),
                "RetailBank");

            Assert.IsNotNull(testObj);
        }
        public async Task AllKeys_TestMethod()
        {
            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Bank", "Account", "Instance 123"),
                "RetailBank");

            var allKeys = await testReader.GetAllInstanceKeys(null);

            Assert.IsNotNull(allKeys);
        }
        public void Projection_Constructor_TestMethod()
        {
            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Domain Test", "Entity Type Test", "Instance 123"),
                "RetailBank");

            ProjectionProcessor testObj = new ProjectionProcessor(testReader);

            Assert.IsNotNull(testReader);
        }
Beispiel #4
0
        /// <summary>
        /// Create a classification processor to run over the given event stream's backing store
        /// </summary>
        public IClassificationProcessor CreateClassificationProcessorForEventStream(ClassificationAttribute attribute)
        {
            string connectionStringName = GetConnectionStringName(attribute);

            if (GetBackingImplementationType(attribute).Equals(EventStreamSetting.EVENTSTREAMIMPLEMENTATIOIN_TABLE, StringComparison.OrdinalIgnoreCase))
            {
                return(TableEventStreamReader.CreateClassificationProcessor(attribute, connectionStringName: connectionStringName));
            }

            // Default to AppendBlob
            return(BlobEventStreamReader.CreateClassificationProcessor(attribute, connectionStringName));
        }
        public async Task Projection_NotExists_TestMethod()
        {
            bool expected = false;
            bool actual   = true;

            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Domain Test", "Entity Type Test", "Instance is not existing abc.def"),
                "RetailBank");

            ProjectionProcessor testObj = new ProjectionProcessor(testReader);

            actual = await testObj.Exists();

            Assert.AreEqual(expected, actual);
        }
        public async Task Projection_Exists_TestMethod()
        {
            bool expected = true;
            bool actual   = false;

            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Bank", "Account", "Instance 1234"),
                "RetailBank");

            ProjectionProcessor testObj = new ProjectionProcessor(testReader);

            actual = await testObj.Exists();

            Assert.AreEqual(expected, actual);
        }
        public void Projection_MockProjectionOne_TestMethod()
        {
            int notexpected = 0;
            int actual      = 0;

            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Domain Test", "Entity Type Test", "Instance 123"),
                "RetailBank");

            ProjectionProcessor testObj = new ProjectionProcessor(testReader);

            var result = testObj.Process <MockProjectionOne>();

            actual = result.Result.TotalCount;

            Assert.AreNotEqual(notexpected, actual);
        }
        public void Projection_MockProjectionOne_TestMethod()
        {
            decimal notexpected = 0;
            decimal actual      = 0;

            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Bank", "Account", "Instance 1234"),
                "RetailBank");

            ProjectionProcessor testObj = new ProjectionProcessor(testReader);

            var result = testObj.Process <MockBalanceProjection>();

            actual = result.Result.CurrentBalance;

            Assert.AreNotEqual(notexpected, actual);
        }
        public void Projection_MockBalanceProjection_TestMethod()
        {
            decimal notexpected = 0;
            decimal actual      = 0;

            TableEventStreamReader testReader = new TableEventStreamReader(
                new EventStreamAttribute("Bank", "Account", "Instance 1234"),
                "RetailBank");

            ProjectionProcessor testObj = new ProjectionProcessor(testReader);

            MockBalanceProjection prior = new MockBalanceProjection();

            // start from event # 2
            prior.SetLastEventSequence(274);
            prior.SetInitialBalance(123.45M);

            var result = testObj.Process <MockBalanceProjection>(prior);

            actual = result.Result.CurrentBalance;

            Assert.AreNotEqual(notexpected, actual);
        }
Beispiel #10
0
 public ClassificationProcessor(TableEventStreamReader tableEventStreamReader)
 {
     // Initialise the reader to use to read the events to be processed
     this.eventStreamReader = tableEventStreamReader;
 }