Skip to content

Commit

Permalink
Updating test server to add test scenarios for unix time
Browse files Browse the repository at this point in the history
  • Loading branch information
tbombach committed Apr 14, 2016
1 parent 1833d26 commit 166ff89
Show file tree
Hide file tree
Showing 10 changed files with 1,360 additions and 5 deletions.
4 changes: 4 additions & 0 deletions AutoRest/Generators/CSharp/CSharp.Tests/AcceptanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,16 @@ public void IntegerTests()
client.IntModel.PutMin32(Int32.MinValue);
client.IntModel.PutMax64(Int64.MaxValue);
client.IntModel.PutMin64(Int64.MinValue);
client.IntModel.PutUnixTimeDate(new DateTime(2016, 4, 13, 0, 0, 0));
client.IntModel.GetNull();
Assert.Throws<SerializationException>(() => client.IntModel.GetInvalid());
Assert.Throws<SerializationException>(() => client.IntModel.GetOverflowInt32());
Assert.Throws<SerializationException>(() => client.IntModel.GetOverflowInt64());
Assert.Throws<SerializationException>(() => client.IntModel.GetUnderflowInt32());
Assert.Throws<SerializationException>(() => client.IntModel.GetUnderflowInt64());
Assert.Throws<SerializationException>(() => client.IntModel.GetInvalidUnixTime());
Assert.Null(client.IntModel.GetNullUnixTime());
Assert.Equal(new DateTime(2016, 4, 13, 0, 0, 0), client.IntModel.GetUnixTime());
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,47 @@ public partial interface IIntModel
/// The cancellation token.
/// </param>
Task<HttpOperationResponse> PutMin64WithHttpMessagesAsync(long intBody, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get datetime encoded as Unix time value
/// </summary>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<HttpOperationResponse<DateTime?>> GetUnixTimeWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Put datetime encoded as Unix time
/// </summary>
/// <param name='intBody'>
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<HttpOperationResponse> PutUnixTimeDateWithHttpMessagesAsync(DateTime intBody, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get invalid Unix time value
/// </summary>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<HttpOperationResponse<DateTime?>> GetInvalidUnixTimeWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get null Unix time value
/// </summary>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
Task<HttpOperationResponse<DateTime?>> GetNullUnixTimeWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Loading

0 comments on commit 166ff89

Please sign in to comment.