public KycStatusClient(MyNoSqlReadRepository <KycProfileNoSqlEntity> readerKycStatuses, IKycStatusService kycStatusService) { _readerKycStatuses = readerKycStatuses; _kycStatusService = kycStatusService; _readerKycStatuses.SubscribeToUpdateEvents(list => Changed(), list => Changed()); }
public void TestInitTableWithMixedNewData() { var entity1 = new TestEntity { PartitionKey = "PK", RowKey = "RK", TimeStamp = "0" }; var entity2 = new TestEntity { PartitionKey = "PK2", RowKey = "RK2", TimeStamp = "2" }; var subscriberMock = new MyNoSqlSubscriberMock(); var dataReader = new MyNoSqlReadRepository <TestEntity>(subscriberMock, "test"); var updates = new List <TestEntity>(); var deletes = new List <TestEntity>(); dataReader.SubscribeToUpdateEvents(updates.AddRange, deletes.AddRange); subscriberMock.InitAction(new[] { entity1 }); subscriberMock.UpdateAction(new[] { entity2 }); Assert.AreEqual(2, updates.Count); Assert.AreEqual(0, deletes.Count); updates.Clear(); subscriberMock.InitAction(new[] { entity2 }); Assert.AreEqual(0, updates.Count); Assert.AreEqual(1, deletes.Count); }
public IMyNoSqlServerDataReader <BidAskNoSql> SubscribeToUpdateEvents(Action <IReadOnlyList <BidAskNoSql> > updateSubscriber, Action <IReadOnlyList <BidAskNoSql> > deleteSubscriber) { return(_reader.SubscribeToUpdateEvents(updateSubscriber, deleteSubscriber)); }