Example #1
0
    public async Task TestAddNumericColumn()
    {
        await _spannerFixture.CreateVenuesTableAndInsertDataAsync();

        AddNumericColumnAsyncSample addColumnSample = new AddNumericColumnAsyncSample();
        await addColumnSample.AddNumericColumnAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId);

        await _spannerFixture.DeleteVenuesTable();
    }
    public async Task TestAddNumericColumnAsync()
    {
        var databaseId = $"my-db-{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}";
        CreateDatabaseAsyncSample sample = new CreateDatabaseAsyncSample();
        await sample.CreateDatabaseAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, databaseId);

        await _spannerFixture.CreateVenuesTableAndInsertDataAsync(databaseId);

        AddNumericColumnAsyncSample addNumericColumnAsyncSample = new AddNumericColumnAsyncSample();
        await addNumericColumnAsyncSample.AddNumericColumnAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, databaseId);
    }
Example #3
0
    public async Task TestQueryDataWithNumericParameter()
    {
        await _spannerFixture.CreateVenuesTableAndInsertDataAsync();

        AddNumericColumnAsyncSample addColumnSample = new AddNumericColumnAsyncSample();
        await addColumnSample.AddNumericColumnAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId);

        UpdateDataWithNumericAsyncSample updateNumericSample = new UpdateDataWithNumericAsyncSample();
        await updateNumericSample.UpdateDataWithNumericAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId);

        QueryDataWithNumericParameterAsyncSample queryNumericSample = new QueryDataWithNumericParameterAsyncSample();
        var venues = await queryNumericSample.QueryDataWithNumericParameterAsync(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId);

        Assert.Contains(venues, v => v.VenueId == 4);

        await _spannerFixture.DeleteVenuesTable();
    }