Ejemplo n.º 1
0
        public async Task WhenInvalidCacheDataRequest_ThenValidateEventGridCacheDataRequestReturnsOKWithInvalidFlag()
        {
            A.CallTo(() => fakeEnterpriseEventCacheDataRequestValidator.Validate(A <EnterpriseEventCacheDataRequest> .Ignored))
            .Returns(new ValidationResult(new List <ValidationFailure>
            {
                new ValidationFailure("PostESSWebhook", "OK")
            }));

            var result = await service.ValidateEventGridCacheDataRequest(new EnterpriseEventCacheDataRequest()
            {
                Attributes = new List <Attribute>()
                {
                    new Attribute()
                    {
                        Key = null
                    }
                }
            });

            A.CallTo(() => fakeAzureTableStorageClient.DeleteAsync(A <TableEntity> .Ignored, A <string> .Ignored, A <string> .Ignored, A <string> .Ignored)).MustNotHaveHappened();
            A.CallTo(() => fakeAzureBlobStorageClient.DeleteCacheContainer(A <string> .Ignored, A <string> .Ignored)).MustNotHaveHappened();

            Assert.IsFalse(result.IsValid);
        }
Ejemplo n.º 2
0
 public Task <ValidationResult> ValidateEventGridCacheDataRequest(EnterpriseEventCacheDataRequest enterpriseEventCacheDataRequest)
 {
     return(enterpriseEventCacheDataRequestValidator.Validate(enterpriseEventCacheDataRequest));
 }