public void ProcessData() { //Arrange var mockProcessor = new Mock <IComponentFunction>(); var sut = new BisectExtensionConcreteDecorator(mockProcessor.Object, new BisectConfig(), 5, new Mock <IShardMetrics>().Object); var records = Enumerable.Range(0, 10).Select(i => new AWSLambdaBisectExtension.Decorator.Record(StringToStream("Record:" + i), new Dictionary <string, object>())); //Act var result = sut.Handle(records); //Assert }
public void FunctionHandler(KinesisEvent kinesisEvent, ILambdaContext context) { var totalReceived = kinesisEvent.Records.Count; context.Logger.LogLine($"===Init===, received{totalReceived}"); if (kinesisEvent != null && kinesisEvent.Records != null && kinesisEvent.Records.Any()) { var records = kinesisEvent.Records.Select(r => new Record(r.Kinesis.Data, new Dictionary <string, object> { ["functionName"] = context.FunctionName })); var bisectDecorator = new BisectExtensionConcreteDecorator(new ConcreteCompMyProcessing(), new BisectConfig(), totalReceived, new CloudWatchShardMetrics()); bisectDecorator.Handle(records); } else { context.Logger.LogLine("===No KinesisEvent records available"); } }