コード例 #1
0
        public static async Task SetupRecords(ITableStore <TestTableEntity> tableStorage)
        {
            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("John", "Smith")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Jane", "Smith")
                {
                    Age = 28, Email = "*****@*****.**"
                }
            };

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Fred", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                },
                new TestTableEntity("Bill", "Jones")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            entityList.Combine(anotherEntityList);

            await tableStorage.CreateTableAsync().ConfigureAwait(false);

            await tableStorage.InsertAsync(entityList).ConfigureAwait(false);
        }
コード例 #2
0
        public async Task table_does_exist_then_exist_check_returns_true()
        {
            // Arrange
            await _tableStorage.DeleteTableAsync();

            await _tableStorage.CreateTableAsync();

            // Act
            var result = await _tableStorage.TableExistsAsync();

            // Assert
            result.Should().BeTrue();
        }
コード例 #3
0
        public static async Task SetupRecordsAgo(ITableStore <TestTableEntity> tableStorage, string ago)
        {
            await tableStorage.DeleteAllAsync();

            var entityList = new List <TestTableEntity>
            {
                new TestTableEntity("Kevin", "Bacon")
                {
                    Age = 21, Email = "*****@*****.**"
                },
                new TestTableEntity("Steven", "Jones")
                {
                    Age = 32, Email = "*****@*****.**"
                }
            };

            await tableStorage.CreateTableAsync().ConfigureAwait(false);

            await tableStorage.InsertAsync(entityList).ConfigureAwait(false);

            await Task.Delay(TimeStringParser.GetTimeAgoTimeSpan(ago));

            var anotherEntityList = new List <TestTableEntity>
            {
                new TestTableEntity("Liam", "Matthews")
                {
                    Age = 28, Email = "*****@*****.**"
                },
                new TestTableEntity("Mary", "Gates")
                {
                    Age = 45, Email = "*****@*****.**"
                }
            };

            await tableStorage.InsertAsync(anotherEntityList).ConfigureAwait(false);
        }