Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

NCBC-174:Fix invalid tests in Nunit project: Change the expected mess…

…age and set default Http timeout to 1 minute

Change-Id: I852e77ee508cd75e81704150596e94d345fa6587
Reviewed-on: http://review.couchbase.org/24394
Reviewed-by: John C. Zablocki <john@couchbase.com>
Tested-by: John C. Zablocki <john@couchbase.com>
  • Loading branch information...
commit cc9985564d440cd0f700134da434190e8be71c84 1 parent 2cae463
@johnzablocki johnzablocki authored John C. Zablocki committed
View
2  src/Couchbase.Tests/CouchbaseClusterBucketAdminTests.cs
@@ -450,7 +450,7 @@ public void When_Creating_New_Bucket_With_Auth_Type_Sasl_And_Port_Argument_Excep
/// @post: Test passes if bucket is error is thrown
/// </summary>
[Test]
- [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Quota.RAM", MatchType = MessageMatch.Contains)]
+ [ExpectedException(typeof(ArgumentException), ExpectedMessage = "RamQuotaMB must be at least 100", MatchType = MessageMatch.Contains)]
public void When_Creating_New_Bucket_With_Ram_Quota_Less_Than_100_Argument_Exception_Is_Thrown()
{
_Cluster.CreateBucket(new Bucket
View
36 src/Couchbase.Tests/DefaultCouchbaseClientConfigurationTests.cs
@@ -147,30 +147,30 @@ public void When_Using_App_Config_And_Design_Document_Name_Transformer_Is_Not_Se
#region Timeouts
/// <summary>
- /// @test: Create couchbase client and dont set time out, default would be 20 seconds
+ /// @test: Create couchbase client and dont set time out, default would be one minute
/// @pre: Provide configuration of client in app.config
- /// @post: Test passes if http request time out is 20 seconds
+ /// @post: Test passes if http request time out is one minute
/// </summary>
- [Test]
- public void When_Http_Timeout_Is_Not_Set_And_Using_App_Config_Default_Is_20_Seconds()
- {
- var config = ConfigurationManager.GetSection("httptimeout-default-config") as CouchbaseClientSection;
- Assert.That(config, Is.Not.Null, "Config was null");
- Assert.That(config.Servers.HttpRequestTimeout, Is.EqualTo(TimeSpan.FromSeconds(20)));
- }
+ [Test]
+ public void When_Http_Timeout_Is_Not_Set_And_Using_App_Config_Default_Is_One_Minute()
+ {
+ var config = ConfigurationManager.GetSection("httptimeout-default-config") as CouchbaseClientSection;
+ Assert.That(config, Is.Not.Null, "Config was null");
+ Assert.That(config.Servers.HttpRequestTimeout, Is.EqualTo(TimeSpan.FromMinutes(1)));
+ }
/// <summary>
- /// @test: Create couchbase client using code configuration and dont set time out, default would be 20 seconds
+ /// @test: Create couchbase client using code configuration and dont set time out, default would be one minute
/// @pre: Provide configuration of client in code
- /// @post: Test passes if http request time out is 20 seconds
+ /// @post: Test passes if http request time out is one minute
/// </summary>
- [Test]
- public void When_Http_Timeout_Is_Not_Set_And_Using_Code_Config_Default_Is_20_Seconds()
- {
- var config = new CouchbaseClientConfiguration();
- Assert.That(config, Is.Not.Null, "Config was null");
- Assert.That(config.HttpRequestTimeout, Is.EqualTo(TimeSpan.FromSeconds(20)));
- }
+ [Test]
+ public void When_Http_Timeout_Is_Not_Set_And_Using_Code_Config_Default_Is_One_Minute()
+ {
+ var config = new CouchbaseClientConfiguration();
+ Assert.That(config, Is.Not.Null, "Config was null");
+ Assert.That(config.HttpRequestTimeout, Is.EqualTo(TimeSpan.FromMinutes(1)));
+ }
/// <summary>
/// @test: Create couchbase client, set time out to 30 seconds, server time out should be 30 seconds,
View
2  src/Couchbase.Tests/HelperTests/DocHelperTests.cs
@@ -17,7 +17,7 @@ public void When_Inserting_Id_Into_Doc_Json_String_Is_Valid_And_Contains_Id()
var json = "{ \"message\" : \"Test\" }";
var jsonWithId = DocHelper.InsertId(json, "8675309");
- Assert.That(jsonWithId, Is.StringContaining("\"_id\":\"8675309\""));
+ Assert.That(jsonWithId, Is.StringContaining("\"id\":\"8675309\""));
Assert.That(JsonConvert.DeserializeObject(jsonWithId), Is.Not.Null);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.