Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

csharp: Remove tests of generated code #1153

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 0 additions & 242 deletions csharp/Svix.Tests/ApplicationTests.cs
Original file line number Diff line number Diff line change
@@ -43,247 +43,5 @@ public void ApplicationCreateAsync_WithoutApplication_ThrowsException()
// Assert
Assert.ThrowsAsync<ArgumentNullException>(() => _svixClient.Application.CreateAsync(null, null, null, default));
}

[Fact]
public void ApplicationCreate_WithoutOptions_CallsApi_WithoutOptions()
{
// Arrange
var lName = "app_name_08q73yhrngv";
var lUid = "08273gh45";
var lRateLimit = 30;

ApplicationCreateOptions lOptions = null;
var lApplication = new ApplicationIn(lName, lRateLimit, lUid);

// Act
var lApplicationOut = _svixClient.Application.Create(lApplication, lOptions, null);

// Assert
_mockApplicationApi.Verify(x => x.CreateApplicationApiV1AppPost(lApplication, It.IsAny<bool>(), null));
}

[Fact]
public void ApplicationCreateAsync_WithoutOptions_CallsApi_WithoutOptions()
{
// Arrange
var lName = "app_name_08q73yhrngv";
var lUid = "08273gh45";
var lRateLimit = 30;

ApplicationCreateOptions lOptions = null;
var lApplication = new ApplicationIn(lName, lRateLimit, lUid);

// Act
var lResult = _svixClient.Application.CreateAsync(lApplication, lOptions, null, default);

// Assert
_mockApplicationApi.Verify(x => x.CreateApplicationApiV1AppPostAsync(lApplication, It.IsAny<bool>(), null, default));
}

[Fact]
public void ApplicationCreate_WithOptions_CallsApi_WithOptions()
{
// Arrange
var lName = "app_name_08q73yhrngv";
var lUid = "08273gh45";
var lRateLimit = 30;

var lApplication = new ApplicationIn(lName, lRateLimit, lUid);
ApplicationCreateOptions lOptions = new ApplicationCreateOptions
{
GetIfExists = true
};

// Act
var lApplicationOut = _svixClient.Application.Create(lApplication, lOptions, null);

// Assert
_mockApplicationApi.Verify(x => x.CreateApplicationApiV1AppPost(lApplication, true, null));
}

[Fact]
public void ApplicationCreateAsync_WithOptions_CallsApi_WithOptions()
{
// Arrange
var lName = "app_name_08q73yhrngv";
var lUid = "08273gh45";
var lRateLimit = 30;

var lApplication = new ApplicationIn(lName, lRateLimit, lUid);
ApplicationCreateOptions lOptions = new ApplicationCreateOptions
{
GetIfExists = true
};

// Act
var lApplicationOut = _svixClient.Application.CreateAsync(lApplication, lOptions, null, default);

// Assert
_mockApplicationApi.Verify(x => x.CreateApplicationApiV1AppPostAsync(lApplication, true, null, default));
}

[Fact]
public void ApplicationDelete_CallsAPi_WithParams()
{
// Arrange
string lApplicationId = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
string lIdempotencyKey = Guid.NewGuid().ToString();

_mockApplicationApi.Setup(x => x.DeleteApplicationApiV1AppAppIdDeleteWithHttpInfo(It.IsAny<string>(), It.IsAny<string>()))
.Returns(new ApiResponse<object>(HttpStatusCode.NoContent, null));

// Act
var lResult = _svixClient.Application.Delete(lApplicationId, lIdempotencyKey);

// Assert
_mockApplicationApi.Verify(x => x.DeleteApplicationApiV1AppAppIdDeleteWithHttpInfo(lApplicationId, lIdempotencyKey));
}

[Fact]
public void ApplicationDeleteAsync_CallsAPi_WithParams()
{
// Arrange
string lApplicationId = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
string lIdempotencyKey = Guid.NewGuid().ToString();

_mockApplicationApi.Setup(x => x.DeleteApplicationApiV1AppAppIdDeleteWithHttpInfoAsync(It.IsAny<string>(), It.IsAny<string>(), default))
.ReturnsAsync(new ApiResponse<object>(HttpStatusCode.NoContent, null));

// Act
var lResult = _svixClient.Application.DeleteAsync(lApplicationId, lIdempotencyKey, default);

// Assert
_mockApplicationApi.Verify(x => x.DeleteApplicationApiV1AppAppIdDeleteWithHttpInfoAsync(lApplicationId, lIdempotencyKey, default));
}

[Fact]
public void ApplicationGet_CallsAPi_WithParams()
{
// Arrange
string lApplicationId = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
string lIdempotencyKey = Guid.NewGuid().ToString();

// Act
var lResult = _svixClient.Application.Get(lApplicationId, lIdempotencyKey);

// Assert
_mockApplicationApi.Verify(x => x.GetApplicationApiV1AppAppIdGet(lApplicationId, lIdempotencyKey));
}

[Fact]
public void ApplicationGetAsync_CallsAPi_WithParams()
{
// Arrange
string lApplicationId = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
string lIdempotencyKey = Guid.NewGuid().ToString();

// Act
var lResult = _svixClient.Application.GetAsync(lApplicationId, lIdempotencyKey, default);

// Assert
_mockApplicationApi.Verify(x => x.GetApplicationApiV1AppAppIdGetAsync(lApplicationId, lIdempotencyKey, default));
}

[Fact]
public void ApplicationList_WithoutOptions_CallsApi_WithoutOptions()
{
// Arrange
ListOptions lOptions = null;

// Act
var lResult = _svixClient.Application
.List(lOptions);

// Assert
_mockApplicationApi.Verify(x => x.ListApplicationsApiV1AppGet(null, null, null));
}

[Fact]
public void ApplicationListAsync_WithoutOptions_CallsApi_WithoutOptions()
{
// Arrange
ListOptions lOptions = null;

// Act
var lResult = _svixClient.Application
.ListAsync(lOptions);

// Assert
_mockApplicationApi.Verify(x => x.ListApplicationsApiV1AppGetAsync(null, null, null, default));
}

[Fact]
public void ApplicationList_WithOptions_CallsApi_WithOptions()
{
// Arrange
var lIterator = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
var lLimit = 30;

var lOptions = new ListOptions
{
Iterator = lIterator,
Limit = lLimit
};

// Act
var lResult = _svixClient.Application
.List(lOptions);

// Assert
_mockApplicationApi.Verify(x => x.ListApplicationsApiV1AppGet(lIterator, lLimit, null));
}

[Fact]
public void ApplicationListAsync_WithOptions_CallsApi_WithOptions()
{
// Arrange
var lIterator = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
var lLimit = 30;

var lOptions = new ListOptions
{
Iterator = lIterator,
Limit = lLimit
};

// Act
var lResult = _svixClient.Application
.ListAsync(lOptions);

// Assert
_mockApplicationApi.Verify(x => x.ListApplicationsApiV1AppGetAsync(lIterator, lLimit, null, default));
}

[Fact]
public void ApplicationUpdate_CallsAPi_WithParams()
{
// Arrange
string lApplicationId = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
string lIdempotencyKey = Guid.NewGuid().ToString();

var lApplication = new ApplicationIn("MyApplication");

// Act
var lResult = _svixClient.Application.Update(lApplicationId, lApplication, lIdempotencyKey);

// Assert
_mockApplicationApi.Verify(x => x.UpdateApplicationApiV1AppAppIdPut(lApplicationId, lApplication, lIdempotencyKey));
}

[Fact]
public void ApplicationUpdateAsync_CallsAPi_WithParams()
{
// Arrange
string lApplicationId = "app_1srOrx2ZWZBpBUvZwXKQmoEYga2";
string lIdempotencyKey = Guid.NewGuid().ToString();

var lApplication = new ApplicationIn("MyApplication");

// Act
var lResult = _svixClient.Application.UpdateAsync(lApplicationId, lApplication, lIdempotencyKey, default);

// Assert
_mockApplicationApi.Verify(x => x.UpdateApplicationApiV1AppAppIdPutAsync(lApplicationId, lApplication, lIdempotencyKey, default));
}
}
}
91 changes: 0 additions & 91 deletions csharp/Svix.Tests/AuthenticationTests.cs

This file was deleted.

Loading