public async Task GetResouceAsync_ReturnsCorrectResource()
        {
            // arrange
            var secondDbInstanceName = _secondPage.TableNames.First();

            // act
            var result = await _tableDescriptionSource.GetResourceAsync(secondDbInstanceName);

            // assert
            Assert.That(result.Name, Is.EqualTo(secondDbInstanceName));
            Assert.That(result.Resource, Is.InstanceOf <TableDescription>());
            Assert.That(result.Resource.TableName, Is.EqualTo(secondDbInstanceName));
        }
        public async Task GetResourceAsync_ReturnsNullIfSdkThrowsNotFound()
        {
            var dynamoDbFake = new Mock <IAmazonDynamoDB>();

            dynamoDbFake
            .Setup(s => s.ListTablesAsync(
                       It.Is <string>(r => r == null), It.IsAny <CancellationToken>()
                       ))
            .ReturnsAsync(new ListTablesResponse()
            {
                TableNames = new List <string>()
                {
                    "banana"
                }
            });

            dynamoDbFake
            .Setup(s => s.DescribeTableAsync("banana", It.IsAny <CancellationToken>()))
            .Throws(new ResourceNotFoundException("Table not found"))
            //so we know we actually threw this error
            .Verifiable();

            var sut = new TableDescriptionSource(dynamoDbFake.Object);

            var result = await sut.GetResourceAsync("banana");

            dynamoDbFake.Verify();

            Assert.Null(result);
        }