forked from loafle/openapi-generator-original
add test case for c# method
This commit is contained in:
parent
4ce255dc38
commit
047abc63a4
@ -54,6 +54,10 @@ namespace {{packageName}}.Test
|
||||
public void {{operationId}}Test()
|
||||
{
|
||||
// TODO: add unit test for the method '{{operationId}}'
|
||||
{{#allParams}}{{{dataType}}} {{paramName}} = null; // TODO: replace null with proper value
|
||||
{{/allParams}}
|
||||
{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||
{{#returnType}}Assert.IsInstanceOf<{{{returnType}}}> (response, "response is {{{returnType}}}");{{/returnType}}
|
||||
}
|
||||
{{/operation}}{{/operations}}
|
||||
}
|
||||
|
@ -53,6 +53,10 @@ namespace IO.Swagger.Test
|
||||
public void UpdatePetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdatePet'
|
||||
Pet body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.UpdatePet(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -62,6 +66,10 @@ namespace IO.Swagger.Test
|
||||
public void AddPetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'AddPet'
|
||||
Pet body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.AddPet(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -71,6 +79,10 @@ namespace IO.Swagger.Test
|
||||
public void FindPetsByStatusTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'FindPetsByStatus'
|
||||
List<string> status = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.FindPetsByStatus(status);
|
||||
Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -80,6 +92,10 @@ namespace IO.Swagger.Test
|
||||
public void FindPetsByTagsTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'FindPetsByTags'
|
||||
List<string> tags = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.FindPetsByTags(tags);
|
||||
Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -89,6 +105,10 @@ namespace IO.Swagger.Test
|
||||
public void GetPetByIdTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetPetById'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.GetPetById(petId);
|
||||
Assert.IsInstanceOf<Pet> (response, "response is Pet");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -98,6 +118,12 @@ namespace IO.Swagger.Test
|
||||
public void UpdatePetWithFormTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdatePetWithForm'
|
||||
string petId = null; // TODO: replace null with proper value
|
||||
string name = null; // TODO: replace null with proper value
|
||||
string status = null; // TODO: replace null with proper value
|
||||
|
||||
instance.UpdatePetWithForm(petId, name, status);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -107,6 +133,11 @@ namespace IO.Swagger.Test
|
||||
public void DeletePetTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'DeletePet'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string apiKey = null; // TODO: replace null with proper value
|
||||
|
||||
instance.DeletePet(petId, apiKey);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -116,6 +147,12 @@ namespace IO.Swagger.Test
|
||||
public void UploadFileTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UploadFile'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
string additionalMetadata = null; // TODO: replace null with proper value
|
||||
Stream file = null; // TODO: replace null with proper value
|
||||
|
||||
instance.UploadFile(petId, additionalMetadata, file);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -125,6 +162,10 @@ namespace IO.Swagger.Test
|
||||
public void GetPetByIdWithByteArrayTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetPetByIdWithByteArray'
|
||||
long? petId = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.GetPetByIdWithByteArray(petId);
|
||||
Assert.IsInstanceOf<byte[]> (response, "response is byte[]");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -134,6 +175,10 @@ namespace IO.Swagger.Test
|
||||
public void AddPetUsingByteArrayTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'AddPetUsingByteArray'
|
||||
byte[] body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.AddPetUsingByteArray(body);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -53,6 +53,9 @@ namespace IO.Swagger.Test
|
||||
public void GetInventoryTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetInventory'
|
||||
|
||||
var response = instance.GetInventory();
|
||||
Assert.IsInstanceOf<Dictionary<string, int?>> (response, "response is Dictionary<string, int?>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -62,6 +65,10 @@ namespace IO.Swagger.Test
|
||||
public void PlaceOrderTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'PlaceOrder'
|
||||
Order body = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.PlaceOrder(body);
|
||||
Assert.IsInstanceOf<Order> (response, "response is Order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -71,6 +78,10 @@ namespace IO.Swagger.Test
|
||||
public void GetOrderByIdTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetOrderById'
|
||||
string orderId = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.GetOrderById(orderId);
|
||||
Assert.IsInstanceOf<Order> (response, "response is Order");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -80,6 +91,10 @@ namespace IO.Swagger.Test
|
||||
public void DeleteOrderTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'DeleteOrder'
|
||||
string orderId = null; // TODO: replace null with proper value
|
||||
|
||||
instance.DeleteOrder(orderId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -53,6 +53,10 @@ namespace IO.Swagger.Test
|
||||
public void CreateUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'CreateUser'
|
||||
User body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.CreateUser(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -62,6 +66,10 @@ namespace IO.Swagger.Test
|
||||
public void CreateUsersWithArrayInputTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'CreateUsersWithArrayInput'
|
||||
List<User> body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.CreateUsersWithArrayInput(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -71,6 +79,10 @@ namespace IO.Swagger.Test
|
||||
public void CreateUsersWithListInputTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'CreateUsersWithListInput'
|
||||
List<User> body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.CreateUsersWithListInput(body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -80,6 +92,11 @@ namespace IO.Swagger.Test
|
||||
public void LoginUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'LoginUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
string password = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.LoginUser(username, password);
|
||||
Assert.IsInstanceOf<string> (response, "response is string");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -89,6 +106,9 @@ namespace IO.Swagger.Test
|
||||
public void LogoutUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'LogoutUser'
|
||||
|
||||
instance.LogoutUser();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -98,6 +118,10 @@ namespace IO.Swagger.Test
|
||||
public void GetUserByNameTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'GetUserByName'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
|
||||
var response = instance.GetUserByName(username);
|
||||
Assert.IsInstanceOf<User> (response, "response is User");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -107,6 +131,11 @@ namespace IO.Swagger.Test
|
||||
public void UpdateUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'UpdateUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
User body = null; // TODO: replace null with proper value
|
||||
|
||||
instance.UpdateUser(username, body);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -116,6 +145,10 @@ namespace IO.Swagger.Test
|
||||
public void DeleteUserTest()
|
||||
{
|
||||
// TODO: add unit test for the method 'DeleteUser'
|
||||
string username = null; // TODO: replace null with proper value
|
||||
|
||||
instance.DeleteUser(username);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user