예제 #1
0
        public async Task GetFileAsync_Throws_InvalidCastException_If_Store_Does_Not_Support_ITusReadableStore()
        {
            var context = new EventContextForTest
            {
                FileId = Guid.NewGuid().ToString(),
                Store  = Substitute.For <ITusStore>()
            };

            await Should.ThrowAsync(async() => await context.GetFileAsync(), typeof(InvalidCastException));
        }
예제 #2
0
        public async Task GetFileAsync_Returns_Null_If_FileId_Is_Missing()
        {
            var context = new EventContextForTest
            {
                Store = CreateReadableStoreWithExistingFile()
            };

            var file = await context.GetFileAsync();

            file.ShouldBeNull();
        }
예제 #3
0
        public async Task GetFileAsync_Returns_The_File_If_FileId_Is_Set_And_Store_Supports_ITusReadableStore()
        {
            var context = new EventContextForTest
            {
                FileId = Guid.NewGuid().ToString(),
                Store  = CreateReadableStoreWithExistingFile()
            };

            var file = await context.GetFileAsync();

            file.ShouldNotBeNull();
        }