Example #1
0
        public async Task DeleteSurveyAnswersCreatesBlobContainer()
        {
            var mockSurveyContainerFactory = new Mock <ISurveyAnswerContainerFactory>();
            var store = new SurveyAnswerStore(
                new Mock <ITenantStore>().Object,
                mockSurveyContainerFactory.Object,
                new Mock <IAzureQueue <SurveyAnswerStoredMessage> >().Object,
                new Mock <IAzureQueue <SurveyAnswerStoredMessage> >().Object,
                new Mock <IAzureBlobContainer <List <string> > >().Object);

            mockSurveyContainerFactory.Setup(f => f.Create(It.IsAny <string>(), It.IsAny <string>()))
            .Returns(new Mock <IAzureBlobContainer <SurveyAnswer> >().Object);

            await store.DeleteSurveyAnswersAsync("tenant", "slug-name");

            mockSurveyContainerFactory.Verify(f => f.Create("tenant", "slug-name"), Times.Once());
        }