Exemplo n.º 1
0
        public async Task ShouldGetObjectStream()
        {
            var handler = new Handler(s3Factory, statusNotifier, s3GetObjectFacade, logger);
            var request = CreateRequest();
            await handler.Handle(request);

            await s3GetObjectFacade.Received().GetObjectStream(Is(zipLocation));
        }
Exemplo n.º 2
0
        public async Task ShouldRetrieveStateFile(
            string bucket,
            string pipeline,
            Request request,
            [Substitute] SQSEvent sqsEvent,
            [Frozen, Options] IOptions <Config> options,
            [Frozen, Substitute] RequestFactory requestFactory,
            [Frozen, Substitute] S3GetObjectFacade s3GetObjectFacade,
            [Target] Handler handler
            )
        {
            options.Value.StateStore = bucket;
            request.Pipeline         = pipeline;
            requestFactory.CreateFromSqsEvent(Arg.Any <SQSEvent>()).Returns(request);

            await handler.Handle(sqsEvent);

            await s3GetObjectFacade.Received().TryGetObject <StateInfo>(Is(bucket), Is($"{pipeline}/state.json"));
        }