Skip to content
Browse files

NCBC-203 : Restructure .net unit tests

Removed white spaces and incorporated review comments
Removed wait handle, not required

Change-Id: I63605bafd0e93a6d780cf73e5705ac33ce06d5ee
Reviewed-on: http://review.couchbase.org/23604
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Saakshi Manocha <saakshi.manocha@globallogic.com>
Tested-by: Saakshi Manocha <saakshi.manocha@globallogic.com>
  • Loading branch information...
1 parent dcf9d0b commit 5ba5287ecaaa9c0a35d787fbc0706214fccae6dc @saakshimanocha saakshimanocha committed Dec 19, 2012
View
60 src/Couchbase.Tests/App.config
@@ -14,25 +14,34 @@
<section name="httpclient-config-initconn" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
<section name="httpclient-config-noinitconn" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase"/>
<sectionGroup name="enyim.com">
- <section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching" />
+ <section name="log" type="Enyim.Caching.Configuration.LoggerSection, Enyim.Caching"/>
</sectionGroup>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
+ <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
+ <appSettings>
+ <add key="CouchbaseServerUrl" value="http://localhost:8091"/>
+ <add key="DefaultBucketName" value="default"/>
+ <add key="SaslBucketName" value="authenticated"/>
+ <add key="SaslBucketPassword" value="password"/>
+ <add key="UserNameForLoginToCouchbaseServer" value="Administrator"/>
+ <add key="UserPasswordForLoginToCouchbaseServer" value="password"/>
+ </appSettings>
+
<enyim.com>
- <log factory="Enyim.Caching.Log4NetFactory, Enyim.Caching.Log4NetAdapter" />
+ <log factory="Enyim.Caching.Log4NetFactory, Enyim.Caching.Log4NetAdapter"/>
</enyim.com>
- <log4net debug="false">
+ <log4net debug="true">
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender,log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
- <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n" />
+ <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n"/>
</layout>
</appender>
<root>
- <priority value="ALL" />
- <level value="DEBUG" />
- <appender-ref ref="ConsoleAppender" />
+ <priority value="ALL"/>
+ <level value="DEBUG"/>
+ <appender-ref ref="ConsoleAppender"/>
</root>
<logger name="ObserveHandler">
@@ -41,81 +50,82 @@
</log4net>
<couchbase>
- <servers bucket="default" bucketPassword="" username="Administrator" password="qwerty" observeTimeout="00:01:00">
- <add uri="http://localhost:8091/pools" />
+ <servers bucket="default" bucketPassword="" username="Administrator" password="password" observeTimeout="00:01:00">
+ <add uri="http://localhost:8091/pools"/>
</servers>
<documentNameTransformer type="Couchbase.Configuration.ProductionModeNameTransformer, Couchbase" />
<httpClientFactory type="Couchbase.RestSharpHttpClientFactory, Couchbase" />
<socketPool connectionTimeout="00:00:30" />
</couchbase>
<min-config>
- <servers bucket="default" bucketPassword="" username="Administrator" password="qwerty">
- <add uri="http://localhost:8091/pools" />
+ <servers bucket="default" bucketPassword="" username="Administrator" password="password">
+ <add uri="http://localhost:8091/pools"/>
</servers>
</min-config>
<pools-config>
<servers bucket="default">
- <add uri="http://localhost:8091/pools" />
+ <add uri="http://localhost:8091/pools"/>
</servers>
</pools-config>
<pools-default-config>
<servers bucket="default">
- <add uri="http://localhost:8091/pools/default" />
+ <add uri="http://localhost:8091/pools/default"/>
</servers>
</pools-default-config>
<httptimeout-default-config>
<servers bucket="default">
- <add uri="http://localhost:8091/pools/default" />
+ <add uri="http://localhost:8091/pools/default"/>
</servers>
</httptimeout-default-config>
<httptimeout-explicit-config>
<servers bucket="default" httpRequestTimeout="00:00:30">
- <add uri="http://localhost:8091/pools/default" />
+ <add uri="http://localhost:8091/pools/default"/>
</servers>
</httptimeout-explicit-config>
<observe-default-config>
<servers bucket="default">
- <add uri="http://localhost:8091/pools/default" />
+ <add uri="http://localhost:8091/pools/default"/>
</servers>
</observe-default-config>
<observe-explicit-config>
<servers bucket="default" observeTimeout="00:00:30">
- <add uri="http://localhost:8091/pools/default" />
+ <add uri="http://localhost:8091/pools/default"/>
</servers>
</observe-explicit-config>
<heartbeat-config-on>
<servers bucket="default">
- <add uri="http://localhost:8091/pools" />
+ <add uri="http://localhost:8091/pools"/>
</servers>
- <heartbeatMonitor uri="http://localhost:8091/pools" enabled="true" interval="30" />
+ <heartbeatMonitor uri="http://localhost:8091/pools" enabled="true" interval="30"/>
</heartbeat-config-on>
<heartbeat-config-off>
<servers bucket="default">
- <add uri="http://localhost:8091/pools" />
+ <add uri="http://localhost:8091/pools"/>
</servers>
- <heartbeatMonitor enabled="false" />
+ <heartbeatMonitor enabled="false"/>
</heartbeat-config-off>
<httpclient-config-initconn>
<servers bucket="default">
- <add uri="http://localhost:8091/pools" />
+ <add uri="http://localhost:8091/pools"/>
</servers>
- <httpClient initializeConnection="false" />
+ <httpClient initializeConnection="false"/>
</httpclient-config-initconn>
<httpclient-config-noinitconn>
<servers bucket="default">
- <add uri="http://localhost:8091/pools" />
+ <add uri="http://localhost:8091/pools"/>
</servers>
<httpClient initializeConnection="false" timeout="00:00:45"/>
</httpclient-config-noinitconn>
+
</configuration>
View
38 src/Couchbase.Tests/ConfigHelperTests.cs
@@ -12,15 +12,15 @@ namespace Couchbase.Tests
[TestFixture]
public class ConfigHelperTests : CouchbaseClientTestsBase
{
- /// <summary>
- /// @test: Reads the information about available data buckets from pools,
- /// generates a random key-value, stores in the available data bucket, and then
- /// retrive the value by passing the same key for verification
- /// @pre: Add section named "pools-config" in App.config file,
- /// configure all the parameters required to initialize Couchbase client like Uri, bucket, etc.
- /// mention uri = http://Url_Of_Couchbase_Server/pools
- /// @post: Test passes if successfully stores key-value and then able to get value, fails otherwise
- /// </summary>
+ /// <summary>
+ /// @test: Reads the information about available data buckets from pools,
+ /// generates a random key-value, stores in the available data bucket, and then
+ /// retrive the value by passing the same key for verification
+ /// @pre: Add section named "pools-config" in App.config file,
+ /// configure all the parameters required to initialize Couchbase client like Uri, bucket, etc.
+ /// mention uri = http://Url_Of_Couchbase_Server/pools
+ /// @post: Test passes if successfully stores key-value and then able to get value, fails otherwise
+ /// </summary>
[Test]
public void Client_Operations_Succeed_When_Bootstrapping_To_Pools_Root_Uri()
{
@@ -34,19 +34,19 @@ public void Client_Operations_Succeed_When_Bootstrapping_To_Pools_Root_Uri()
GetAssertPass(getResult, value);
}
- /// <summary>
- /// @test: Reads the information about available data buckets from pools/default,
- /// generates a random key-value, stores in the default data bucket, and then
- /// retrive the value by passing the same key for verification
- /// @pre: Add section named "pools-default-config" in App.config file,
- /// configure all the parameters required to initialize Couchbase client like Uri, bucket, etc.
- /// mention uri = http://Url_Of_Couchbase_Server/pools/default
- /// @post: Test passes if successfully stores key-value and then able to get value, fails otherwise
- /// </summary>
+ /// <summary>
+ /// @test: Reads the information about available data buckets from pools/default,
+ /// generates a random key-value, stores in the default data bucket, and then
+ /// retrive the value by passing the same key for verification
+ /// @pre: Add section named "pools-default-config" in App.config file,
+ /// configure all the parameters required to initialize Couchbase client like Uri, bucket, etc.
+ /// mention uri = http://Url_Of_Couchbase_Server/pools/default
+ /// @post: Test passes if successfully stores key-value and then able to get value, fails otherwise
+ /// </summary>
[Test]
public void Client_Operations_Succeed_When_Bootstrapping_To_Pools_Default_Root_Uri()
{
- var config = ConfigSectionUtils.GetConfigSection<CouchbaseClientSection>("pools-default-config");
+ var config = ConfigSectionUtils.GetConfigSection<CouchbaseClientSection>("pools-default-config");
var client = new CouchbaseClient(config);
string key = GetUniqueKey(), value = GetRandomString();
View
59 src/Couchbase.Tests/CouchbaseAuthenticatedViewTests.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.Linq;
using System.Text;
using NUnit.Framework;
@@ -8,59 +9,57 @@
namespace Couchbase.Tests
{
- [TestFixture]
- public class CouchbaseAuthenticatedViewTests : CouchbaseClientViewTestsBase
- {
+ [TestFixture]
+ public class CouchbaseAuthenticatedViewTests : CouchbaseClientViewTestsBase
+ {
/// <summary>
- /// @test: Verifies that for the bucket which is authenticated with password, it is able to connect successfully
+ /// @test: Verifies that for the bucket which is authenticated with password, it is able to connect successfully
/// if correct cedentials are provided and then returns the object representing the view in specfied design document
- /// @pre: Provide the bucket name and password in method getClient(),
+ /// @pre: Provide the bucket name and password in method getClient(),
/// provide correct design name and view name to method GetView()
/// @post: Test passes if connects to client successfully and get the details of View with given data, fails otherwise
/// </summary>
- [Test]
- public void When_Bucket_Is_Authenticated_View_Returns_Results()
- {
- var view = getClient("authenticated", "secret").GetView("cities", "by_name");
- foreach (var item in view) { }
-
- Assert.That(view.Count(), Is.EqualTo(1), "Row count was not 1");
- }
+ [Test]
+ public void When_Bucket_Is_Authenticated_View_Returns_Results()
+ {
+ var client = getClient(ConfigurationManager.AppSettings["SaslBucketName"], ConfigurationManager.AppSettings["SaslBucketPassword"]);
+ var view = client.GetView("cities", "by_name");
+ Assert.That(view.Count(), Is.EqualTo(1), "Row count was not 1");
+ }
/// <summary>
/// @test: Verifies that for the bucket which is authenticated with password, it throws an error
/// if no credentials are provided and hence cannot return the object representing the view in specfied design document
- /// @pre: Provide the bucket name but no password in method getClient(),
+ /// @pre: Provide the bucket name but no password in method getClient(),
/// provide design name and view name to method GetView()
/// @post: Test passes if the web exception (401) is thrown
/// </summary>
[ExpectedException(typeof(InvalidOperationException))]
[Test]
public void When_Bucket_Is_Authenticated_And_No_Credentials_Are_Provided_Exception_Is_Thrown()
{
- var view = getClient("authenticated", "").GetView("cities", "by_name");
+ var client = getClient(ConfigurationManager.AppSettings["SaslBucketName"], "");
+ var view = client.GetView("cities", "by_name");
foreach (var item in view) { Console.WriteLine(item); }
-
}
/// <summary>
/// Connects to couchbase client with given configuration details
/// </summary>
- /// <param name="username">Name of bucket to be used</param>
- /// <param name="password">Password used to connect to bucket</param>
+ /// <param name="bucketName">Name of bucket to be used</param>
+ /// <param name="bucketPassword">Password used to connect to bucket</param>
/// <returns>Couchbase client object</returns>
- private CouchbaseClient getClient(string username, string password)
- {
- var config = new CouchbaseClientConfiguration();
- config.Urls.Add(new Uri("http://localhost:8091/pools"));
- config.Bucket = username;
- config.BucketPassword = password;
- config.DesignDocumentNameTransformer = new DevelopmentModeNameTransformer();
- config.HttpClientFactory = new HammockHttpClientFactory();
-
- return new CouchbaseClient(config);
- }
- }
+ private CouchbaseClient getClient(string bucketName, string bucketPassword)
+ {
+ var config = new CouchbaseClientConfiguration();
+ config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/pools"));
+ config.Bucket = bucketName;
+ config.BucketPassword = bucketPassword;
+ config.DesignDocumentNameTransformer = new DevelopmentModeNameTransformer();
+ config.HttpClientFactory = new HammockHttpClientFactory();
+ return new CouchbaseClient(config);
+ }
+ }
}
#region [ License information ]
View
5 src/Couchbase.Tests/CouchbaseClientCasTests.cs
@@ -12,11 +12,12 @@ namespace Couchbase.Tests
public class CouchbaseClientCasTests : CouchbaseClientTestsBase
{
/// <summary>
- /// @test: Store a randomly generated unique key-value, use he CAS value
+ /// @test: Store a randomly generated unique key-value, use he CAS value
/// returned from the Store(), then use ExecuteCas() method
/// to compare and set a value using the specified key and return the store operation result
/// @pre: No section required in App.config file
- /// @post: Test passes if successfully able to retrieve the same cas value, fails otherwise
+ /// @post: Test passes if successfully able to add a key-value pair and then retrieve the same cas value,
+ /// fails otherwise
/// </summary>
[Test]
public void When_Storing_Item_With_Valid_Cas_Result_Is_Successful()
View
20 src/Couchbase.Tests/CouchbaseClientConcatTests.cs
@@ -10,11 +10,10 @@ namespace Couchbase.Tests
public class CouchbaseClientConcatTests : CouchbaseClientTestsBase
{
/// <summary>
- /// @test: Store a randomly generated unique key-value, use the different
- /// cas value in ExecuteCas() mehod than what is returned by Store() method,
- /// the ExecuteCas() fails due to invalid cas passed
- /// @pre: No section required in App.config file
- /// @post: Test passes if ExecuteCas() fails due to invalid cas, fails if ExecuteCas() passes
+ /// @test: Store a randomly generated unique key-value, use ExecuteAppend() to append some string
+ /// to its value and then get the new string after appending
+ /// @pre: No section required in App.config file, it picks up the default configuration
+ /// @post: Test passes if ExecuteAppend() passes and Get method returns the new string after appending text to it
/// </summary>
[Test]
public void When_Appending_To_Existing_Value_Result_Is_Successful()
@@ -37,7 +36,7 @@ public void When_Appending_To_Existing_Value_Result_Is_Successful()
/// <summary>
/// @test: Generate a unique key, use ExecuteAppend() to save data in that key,
- /// since the key does not exist aleady, append operation would fail, then get value from
+ /// since the key does not exist already, append operation would fail, then get value from
/// the same key, it will fail again as the key does not exist
/// @pre: Generate a unique key and data to append in that key
/// @post: Test passes if ExecuteAppend() and ExecuteGet() both fail, which is the expected behaviour
@@ -104,10 +103,11 @@ public void When_Prepending_To_Invalid_Key_Result_Is_Not_Successful()
}
/// <summary>
- /// @test: Generate a unique key and store it, Prepend some text to that key-value,
- /// it should pass, then get the value against the same key, it should pass
+ /// @test: Generate a unique key and store it, test checks to see that
+ /// the final output key contains both the 'original' (i.e. "concat") value as well as
+ /// the appended value. (i.e. "concatTheEnd")
/// @pre: Generate a unique key and data to append in that key
- /// @post: Test passes if ExecutePrepend() and ExecuteGet() both pass
+ /// @post: Test passes if ExecuteAppend() and ExecuteGet() both pass
/// </summary>
[Test]
public void When_Appending_To_Existing_Value_Result_Is_Successful_With_Valid_Cas()
@@ -177,7 +177,7 @@ public void When_Prepending_To_Existing_Value_Result_Is_Successful_With_Valid_Ca
/// @test: Generate a unique key and store it, Append some text and use the different cas key,
/// the test should fail
/// @pre: Generate a unique key and data to append in that key
- /// @post: Test passes if ExecuteAppend() passes
+ /// @post: Test passes if ExecuteAppend() fails since the Cas is invalid
/// </summary>
[Test]
public void When_Prepending_To_Existing_Value_Result_Is_Not_Successful_With_Invalid_Cas()
View
9 src/Couchbase.Tests/CouchbaseClientConfigTests.cs
@@ -14,20 +14,19 @@ public class CouchbaseClientConfigTests
/// <summary>
/// @test: Reads the information about couchbase client configuration from App.Config,
/// and verifies that all properties are set
- /// @pre: Add section named "couchbase" in App.config file,
+ /// @pre: Add section named "couchbase" in App.config file,
/// configure all the parameters required to initialize Couchbase client like Uri, bucket, username, password etc.
/// @post: Test passes if able to retrieve couchbase client configuration, the username and password match with
/// expected details, fails otherwise
/// </summary>
[Test]
public void When_Setting_Username_And_Password_In_Config_Section_Config_Instance_Properties_Are_Set()
{
- var config = ConfigurationManager.GetSection("couchbase") as CouchbaseClientSection;
+ var config = ConfigurationManager.GetSection("couchbase") as CouchbaseClientSection;
Assert.That(config, Is.Not.Null, "Config was null");
- Assert.That(config.Servers.Username, Is.StringMatching("Administrator"));
- Assert.That(config.Servers.Password, Is.StringMatching("qwerty"));
+ Assert.That(config.Servers.Username, Is.StringMatching(ConfigurationManager.AppSettings["UserNameForLoginToCouchbaseServer"]));
+ Assert.That(config.Servers.Password, Is.StringMatching(ConfigurationManager.AppSettings["UserPasswordForLoginToCouchbaseServer"]));
}
-
}
}
View
2 src/Couchbase.Tests/CouchbaseClientExtensionsTests.cs
@@ -12,7 +12,7 @@ namespace Couchbase.Tests
public class CouchbaseClientExtensionsTests : CouchbaseClientTestsBase
{
/// <summary>
- /// @test: Generate a unique key and store key using StoreJson(), without converting into json
+ /// @test: Generate a unique key and store key using StoreJson(), without converting into json
/// the store operation would fail
/// @pre: Generate a unique key and data to append in that key
/// @post: Test passes if ExecuteAppend() passes
View
4 src/Couchbase.Tests/CouchbaseClientGenericViewTests.cs
@@ -1,4 +1,4 @@
-using System;
+ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -16,7 +16,7 @@ public class CouchbaseClientGenericViewTests : CouchbaseClientViewTestsBase
{
/// <summary>
/// @test: Set shouldlookupDocById to true, GetView() method will retrieve
- /// the view by id and verifies that all properties of
+ /// the view by id and verifies that all properties of
/// view type (City in this context) are correct
/// @pre: Define CityViews.json to create views
/// @post: Test passes if GetView returns results correctly
View
2 src/Couchbase.Tests/CouchbaseClientMutateTests.cs
@@ -29,7 +29,7 @@ public void When_Incrementing_Value_Result_Is_Successful()
/// <summary>
/// @test: Store a randomly generated key, with a value lets say 100, decrement
/// the key with the delta of lets say 10, the result of mutation should be 90
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if mutate operation decrements the key correctly
/// </summary>
[Test]
View
87 src/Couchbase.Tests/CouchbaseClientObserveTests.cs
@@ -18,7 +18,7 @@ public class CouchbaseClientObserveTests : CouchbaseClientTestsBase
{
/// <summary>
/// @test: Generate a new key-value tuple, store the key value with master only persistence
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
@@ -32,7 +32,7 @@ public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Master_Only_Persist
/// <summary>
/// @test: Generate a new key-value tuple, store the key value with master only persistence
/// and enable replication to single node
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
@@ -44,22 +44,8 @@ public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Master_Persistence_
}
/// <summary>
- /// @test: Generate a new key-value tuple, store the key value with master only persistence
- /// and replicate to multiple nodes
- /// @pre: Default configuration to initialize client in App.config
- /// @post: Test passes if successfully stores key-value
- /// </summary>
- [Test]
- public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Master_Persistence_And_Mutli_Node_Replication()
- {
- var kv = KeyValueUtils.GenerateKeyAndValue("observe");
- var storeResult = _Client.ExecuteStore(StoreMode.Set, kv.Item1, kv.Item2, PersistTo.One, ReplicateTo.Two);
- StoreAssertPass(storeResult);
- }
-
- /// <summary>
/// @test: Generate a new key-value tuple, store the key value with multiple node persistence
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
@@ -73,7 +59,7 @@ public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Multi_Node_Persiste
/// <summary>
/// @test: Generate a new key-value tuple, store the key value with multiple node persistence
/// and single node replication
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
@@ -86,7 +72,7 @@ public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Multi_Node_Persiste
/// <summary>
/// @test: Generate a new key-value tuple, store the key value with single node replication
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
@@ -99,21 +85,21 @@ public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Single_Node_Replica
/// <summary>
/// @test: Generate a new key-value tuple, store the key value with multiple node replication
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
public void When_Storing_A_New_Key_Observe_Will_Succeed_With_Multi_Node_Replication()
{
var kv = KeyValueUtils.GenerateKeyAndValue("observe");
- var storeResult = _Client.ExecuteStore(StoreMode.Set, kv.Item1, kv.Item2, ReplicateTo.One);
+ var storeResult = _Client.ExecuteStore(StoreMode.Set, kv.Item1, kv.Item2, ReplicateTo.Two);
StoreAssertPass(storeResult);
}
/// <summary>
/// @test: Generate a new key-value tuple, store the key value with three nodes for replication,
/// however the cluster has less than three nodes, then store operation would fail
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if store operayion fails
/// </summary>
[Test]
@@ -125,43 +111,31 @@ public void When_Storing_A_New_Key_Observe_Will_Fail_When_Cluster_Has_Too_Few_No
}
/// <summary>
- /// @test: Generate a new key-value tuple, store the key value. Observe the client with a
- /// different cas value (than what is the result of store operation), and using master persistence
+ /// @test: Generate a new key-value tuple, store the key value. Observe the client with a
+ /// different cas value (than what is the result of store operation), and using master persistence
/// and replication to single node, the store operation would fail
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value
/// </summary>
[Test]
public void When_Storing_A_New_Key_Observe_Will_Fail_With_Master_Persistence_And_Cas_Value_Has_Changed()
{
var kv = KeyValueUtils.GenerateKeyAndValue("observe");
var storeResult = _Client.ExecuteStore(StoreMode.Set, kv.Item1, kv.Item2);
- var observeResult = _Client.Observe(kv.Item2, storeResult.Cas - 1, PersistTo.One, ReplicateTo.Zero);
- Assert.That(observeResult.Success, Is.False);
- Assert.That(observeResult.Message, Is.StringMatching(ObserveOperationConstants.MESSAGE_MODIFIED));
- }
- /// <summary>
- /// @test: Generate a new key-value tuple, store the key value. Observe the client with a
- /// different cas value (than what is the result of store operation), and using master persistence
- /// and replication to multiple node, the store operation would fail
- /// @pre: Default configuration to initialize client in app.config
- /// @post: Test passes if successfully stores key-value
- /// </summary>
- [Test]
- public void When_Storing_A_New_Key_Observe_Will_Fail_With_Master_Persistence_And_Replication_And_Cas_Value_Has_Changed()
- {
- var kv = KeyValueUtils.GenerateKeyAndValue("observe");
- var storeResult = _Client.ExecuteStore(StoreMode.Set, kv.Item1, kv.Item2);
- var observeResult = _Client.Observe(kv.Item2, storeResult.Cas - 1, PersistTo.One, ReplicateTo.Two);
- Assert.That(observeResult.Success, Is.False);
- Assert.That(observeResult.Message, Is.StringMatching(ObserveOperationConstants.MESSAGE_MODIFIED));
+ var observeResult1 = _Client.Observe(kv.Item2, storeResult.Cas - 1, PersistTo.One, ReplicateTo.Zero);
+ Assert.That(observeResult1.Success, Is.False);
+ Assert.That(observeResult1.Message, Is.StringMatching(ObserveOperationConstants.MESSAGE_MODIFIED));
+
+ var observeResult2 = _Client.Observe(kv.Item2, storeResult.Cas - 1, PersistTo.One, ReplicateTo.Two);
+ Assert.That(observeResult2.Success, Is.False);
+ Assert.That(observeResult2.Message, Is.StringMatching(ObserveOperationConstants.MESSAGE_MODIFIED));
}
/// <summary>
/// @test: Create a new design document, save a new key value pair wth master persistence.
/// Get the view result with stale false, the view item should match successfully.
- /// @pre: Default configuration to initialize client in App.config
+ /// @pre: Default configuration to initialize client in App.config
/// @post: Test passes if successfully stores key-value and able to retrieve
/// </summary>
[Test]
@@ -197,29 +171,6 @@ public void When_Storing_A_New_Key_With_Master_Persistence_That_Key_Is_In_View_W
}
/// <summary>
- /// @test: Store a randomly generated unique key value pair, remove the key with master persistence and
- /// then get the value against the key, the get operation would fail
- /// @pre: Default configuration to initialize client in app.config
- /// @post: Test passes if successfully stores and later deletes the key-value and then a
- /// but the get operation after delete should ideally fail
- /// </summary>
- [Test]
- public void When_Observing_A_Removed_Key_Operation_Is_Successful_With_Master_Node_Persistence()
- {
- var key = GetUniqueKey("observe");
- var value = GetRandomString();
-
- var storeResult = Store(StoreMode.Set, key, value);
- StoreAssertPass(storeResult);
-
- var removeResult = _Client.ExecuteRemove(key, PersistTo.One);
- Assert.That(removeResult.Success, Is.True);
-
- var getResult = _Client.ExecuteGet(key);
- GetAssertFail(getResult);
- }
-
- /// <summary>
/// @test: Store a randomly generated unique key value pair, remove the key with master persistence
/// and replication to multiple nodes, then get the value against the key, the get operation would pass
/// @pre: Default configuration to initialize client in app.config
View
4 src/Couchbase.Tests/CouchbaseClientRemoveTests.cs
@@ -17,7 +17,7 @@ public class CouchbaseClientRemoveTests : CouchbaseClientTestsBase
/// @test: Store a randomly generated key, remove that key and then get value
/// agsinst the same key, the Get operation should fail as key is already deleted
/// @pre: Default configuration to initialize client in app.config
- /// @post: Test passes if store and deletion operation are success and Get operation
+ /// @post: Test passes if store and deletion operation are success and Get operation
/// must fail ideally
/// </summary>
[Test]
@@ -37,7 +37,7 @@ public void When_Removing_A_Valid_Key_Result_Is_Successful()
/// <summary>
/// @test: Deleting a key which does not exist will fail the Remove operation
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if Remove operation fails
/// </summary>
[Test]
View
16 src/Couchbase.Tests/CouchbaseClientSpatialViewTests.cs
@@ -13,9 +13,9 @@ namespace Couchbase.Tests
public class CouchbaseClientSpatialViewTests : CouchbaseClientViewTestsBase
{
/// <summary>
- /// @test: Get spatial view of a given design name and view name,
+ /// @test: Get spatial view of a given design name and view name,
/// all the propeties of view should have correct values
- /// @pre: Default configuration to initialize client in app.config, configure
+ /// @pre: Default configuration to initialize client in app.config, configure
/// City views in cluster
/// @post: Test passes if view prperties are not null
/// </summary>
@@ -36,9 +36,9 @@ public void When_Querying_Spatial_View_Results_Are_Returned()
}
/// <summary>
- /// @test: Get spatial view of generic type City of a given design name and view name,
+ /// @test: Get spatial view of generic type City of a given design name and view name,
/// set look up by id to true, all the propeties of view should have correct values
- /// @pre: Default configuration to initialize client in app.config, configure
+ /// @pre: Default configuration to initialize client in app.config, configure
/// City views in cluster
/// @post: Test passes if view prperties are not null
/// </summary>
@@ -58,7 +58,7 @@ public void When_Querying_Spatial_View_With_Generics_And_Should_Lookup_Doc_By_Id
}
/// <summary>
- /// @test: Get spatial view of generic type City of a given design name and view name,
+ /// @test: Get spatial view of generic type City of a given design name and view name,
/// set look up by id to false, all the propeties of view should have correct values
/// @pre: Default configuration to initialize client in app.config, configure
/// City views in cluster
@@ -91,17 +91,17 @@ public void When_Querying_Spatial_View_With_Limit_Rows_Are_Limited()
}
/// <summary>
- /// @test: Get spatial view with bounding box, the result rows would be limited but
+ /// @test: Get spatial view with bounding box, the result rows would be limited but
/// should have at least one record
- /// @pre: Default configuration to initialize client in app.config, configure
+ /// @pre: Default configuration to initialize client in app.config, configure
/// City views in cluster
/// @post: Test passes if view count is at least one
/// </summary>
[Test]
public void When_Querying_Spatial_View_With_Bounding_Box_Rows_Are_Limited()
{
var hasAtLeastOneRecord = false;
- var view = _Client.GetSpatialView("cities", "by_location").BoundingBox(-73.789673f, 41.093704f, -71.592407f, 42.079742f); //bbox around Connecticut
+ var view = _Client.GetSpatialView("cities", "by_location").BoundingBox(-73.789673f, 41.093704f, -71.592407f, 42.079742f); //box around Connecticut
foreach (var item in view)
{
hasAtLeastOneRecord = true;
View
12 src/Couchbase.Tests/CouchbaseClientStoreTests.cs
@@ -29,7 +29,7 @@ public void When_Storing_Item_With_New_Key_And_StoreMode_Add_Result_Is_Successfu
/// <summary>
/// @test: Store a randomly generated key, store again using same key with Add operation,
/// the result will not be successful
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if new key is added first time and second time it fails
/// </summary>
[Test]
@@ -45,7 +45,7 @@ public void When_Storing_Item_With_Existing_Key_And_StoreMode_Add_Result_Is_Not_
/// <summary>
/// @test: Store a new key with store mode replace will fail as the key does not exist
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if replace fails
/// </summary>
[Test]
@@ -59,7 +59,7 @@ public void When_Storing_Item_With_New_Key_And_StoreMode_Replace_Result_Is_Not_S
/// <summary>
/// @test: Store a randomly generated key, with store mode Add, then change the key
/// with store mode replace, key should be replaced successfully
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if new key is added and later replaced successfully
/// </summary>
[Test]
@@ -74,9 +74,9 @@ public void When_Storing_Item_With_Existing_Key_And_StoreMode_Replace_Result_Is_
}
/// <summary>
- /// @test: Store a randomly generated key, with store mode Set,
+ /// @test: Store a randomly generated key, with store mode Set,
/// new key should be stored correctly
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if new key is stored successfully
/// </summary>
[Test]
@@ -90,7 +90,7 @@ public void When_Storing_Item_With_New_Key_And_StoreMode_Set_Result_Is_Successfu
/// <summary>
/// @test: Store a randomly generated key, with store mode Add, then change the key
/// with store mode set, key should be set successfully
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if new key is stored successfully
/// </summary>
[Test]
View
4 src/Couchbase.Tests/CouchbaseClientViewNameTransformerTests.cs
@@ -13,7 +13,7 @@ public class CouchbaseClientViewNameTransformerTests : CouchbaseClientViewTestsB
{
/// <summary>
/// @test: Design document name is prefixed with "dev_" in development mode
- /// @pre: Default configuration to initialize client in app.config, create a design document in server named "foo"
+ /// @pre: Default configuration to initialize client in app.config, create a design document in server named "foo"
/// @post: Test passes if name changes and is prefixed with dev_ as expected
/// </summary>
[Test]
@@ -24,7 +24,7 @@ public void When_Setting_Design_Document_Name_Transformer_To_Dev_Views_Are_Prefi
/// <summary>
/// @test: Design document name is not prefixed in production views
- /// @pre: Default configuration to initialize client in app.config, create a design document in server named "foo"
+ /// @pre: Default configuration to initialize client in app.config, create a design document in server named "foo"
/// @post: Test passes if name does not change and is not prefixed with any string
/// </summary>
[Test]
View
8 src/Couchbase.Tests/CouchbaseClientViewPagingTests.cs
@@ -11,7 +11,7 @@ public class CouchbaseClientViewPagingTests : CouchbaseClientViewTestsBase
{
/// <summary>
/// @test: Get the view results and display all items of an index in pages
- /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
+ /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
/// @post: Test passes if it retrives all items in view and page size is correct
/// </summary>
[Test]
@@ -24,7 +24,7 @@ public void When_Paging_Non_Generic_View_Page_Sizes_Are_Correct()
/// <summary>
/// @test: Get view results with generic type, key and id are not set, page results will throw error
- /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
+ /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
/// @post: Test passes if the view results throw invalid operation exception
/// </summary>
[Test]
@@ -40,7 +40,7 @@ public void Paging_Generic_View_Throws_Exception_When_Key_And_Id_Are_Not_Set()
/// <summary>
/// @test: Get view results with generic type, key and if are set properly,
/// page results will display correct results
- /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
+ /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
/// @post: Test passes if the view results show correct page sizes
/// </summary>
[Test]
@@ -54,7 +54,7 @@ public void When_Paging_Generic_View_Page_Sizes_Are_Correct()
/// <summary>
/// @test: Get view results with generic type, key and id are set, paging view count is correct
- /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
+ /// @pre: Default configuration to initialize client in app.config, configure view name 'by_name' with design name 'cities'
/// @post: Test passes if thecount of view results is correct
/// </summary>
[Test]
View
4 src/Couchbase.Tests/CouchbaseClientViewReduceTests.cs
@@ -11,7 +11,7 @@ public class CouchbaseClientViewReduceTests : CouchbaseClientViewTestsBase
{
/// <summary>
/// @test: Row count of view result is one when it is not grouped
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if the view count is one
/// </summary>
[Test]
@@ -25,7 +25,7 @@ public void When_View_Is_Reduced_Without_Group_Row_Count_Is_One()
/// <summary>
/// @test: Row count of view result is greater than one when it is grouped
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if the view count is greater than one
/// </summary>
[Test]
View
4 src/Couchbase.Tests/CouchbaseClientViewTests.cs
@@ -13,7 +13,7 @@ public class CouchbaseClientViewTests : CouchbaseClientViewTestsBase
/// <summary>
/// @test: Retrieve view result with debug true should return debug information
/// of data type dictionary
- /// @pre: Default configuration to initialize client in app.config and have view wih design document cities and view name by_name
+ /// @pre: Default configuration to initialize client in app.config and have view wih design document cities and view name by_name
/// @post: Test passes if debug info is returned correctly
/// </summary>
[Test]
@@ -44,7 +44,7 @@ public void When_Querying_View_With_Debug_True_Debug_Info_Dictionary_Is_Returned
/// <summary>
/// @test: Retrieve view result with debug false should return no debug information
- /// @pre: Default configuration to initialize client in app.config and have view wih design document cities and view name by_name
+ /// @pre: Default configuration to initialize client in app.config and have view wih design document cities and view name by_name
/// @post: Test passes if no debug info is returned
/// </summary>
[Test]
View
9 src/Couchbase.Tests/CouchbaseClientViewTestsBase.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.Linq;
using System.Text;
using Couchbase.Configuration;
@@ -25,8 +26,8 @@ public void Setup()
protected Tuple<CouchbaseClient, CouchbaseClientConfiguration> GetClientWithConfig(INameTransformer nameTransformer = null)
{
var config = new CouchbaseClientConfiguration();
- config.Urls.Add(new Uri("http://localhost:8091/pools/default"));
- config.Bucket = "default";
+ config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/pools"));
+ config.Bucket = ConfigurationManager.AppSettings["CouchbaseServerUrl"];
config.DesignDocumentNameTransformer = nameTransformer ?? new DevelopmentModeNameTransformer();
config.HttpClientFactory = new MockHttpClientFactory();
@@ -44,10 +45,10 @@ protected void CreateViewFromFile(string viewFile, string docName)
{
var viewContent = File.ReadAllText(viewFile).Replace("[[DESIGNDOC]]", docName);
byte[] arr = System.Text.Encoding.UTF8.GetBytes(viewContent);
- var request = (HttpWebRequest)HttpWebRequest.Create("http://localhost:8091/couchBase/default/_design/" + docName);
+ var request = (HttpWebRequest)HttpWebRequest.Create(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/couchBase/default/_design/" + docName);
request.Method = "PUT";
request.ContentType = "application/json";
- request.ContentLength = arr.Length;
+ request.ContentLength = arr.Length;
var dataStream = request.GetRequestStream();
dataStream.Write(arr, 0, arr.Length);
dataStream.Close();
View
20 src/Couchbase.Tests/CouchbaseClusterBucketAdminTests.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.Linq;
using System.Text;
using NUnit.Framework;
@@ -22,7 +23,7 @@ public class CouchbaseClusterBucketAdminTests : CouchbaseClusterTestsBase
{
/// <summary>
/// @test: List buckets in cluster should return default bucket
- /// @pre: Default configuration to initialize client in app.config to initialize client in app.config and cluster should have a default bucket
+ /// @pre: Default configuration to initialize client in app.config to initialize client in app.config and cluster should have a default bucket
/// @post: Test passes if default bucket is found
/// </summary>
[Test]
@@ -33,25 +34,25 @@ public void When_Listing_Buckets_Default_Bucket_Is_Returned()
}
/// <summary>
- /// @test: List buckets in cluster with invalid server configuration
+ /// @test: List buckets in cluster with invalid server configuration
/// should return argument null exception
- /// @pre: Use incorrect configuration of server
+ /// @pre: Use incorrect configuration of server
/// @post: Test passes if error is thrown
/// </summary>
[Test]
[ExpectedException(typeof(ArgumentNullException))]
public void When_Listing_Buckets_With_Invalid_Config_Argument_Exception_Is_Thrown()
{
var config = new CouchbaseClientConfiguration();
- config.Urls.Add(new Uri("http://localhost:8091/doesnotexist/"));
+ config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/doesnotexist/"));
config.Bucket = "default";
var server = new CouchbaseCluster(config);
var buckets = server.ListBuckets();
}
/// <summary>
/// @test: Try List buckets in cluster should return default bucket
- /// @pre: Default configuration to initialize client in app.config and cluster should have a default bucket
+ /// @pre: Default configuration to initialize client in app.config and cluster should have a default bucket
/// @post: Test passes if default bucket is found
/// </summary>
[Test]
@@ -66,14 +67,14 @@ public void When_Try_Listing_Buckets_Default_Bucket_Is_Returned()
/// <summary>
/// @test: Try List buckets in with invalid configuration should return false
/// and no exception is thrown
- /// @pre: Default configuration to initialize client in app.config an use invalid configuration
+ /// @pre: Default configuration to initialize client in app.config an use invalid configuration
/// @post: Test passes if default bucket is found
/// </summary>
[Test]
public void When_Try_Listing_Buckets_With_Invalid_Config_No_Exception_Is_Thrown_And_Return_Value_Is_False()
{
var config = new CouchbaseClientConfiguration();
- config.Urls.Add(new Uri("http://localhost:8091/doesnotexist/"));
+ config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/doesnotexist/"));
config.Bucket = "default";
var server = new CouchbaseCluster(config);
@@ -111,7 +112,7 @@ public void When_Getting_Bucket_That_Bucket_Is_Not_Null()
/// <summary>
/// @test: create invalid bucket, while retrieving bucket, web exception is thrown
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if invalid bucket throws web exception
/// </summary>
[ExpectedException(typeof(WebException))]
@@ -139,7 +140,7 @@ public void When_Getting_Invalid_Bucket_Web_Exception_Is_Thrown()
/// <summary>
/// @test: create sasl bucket and try get bucket should not be null
- /// @pre: Default configuration to initialize client in app.config
+ /// @pre: Default configuration to initialize client in app.config
/// @post: Test passes if bucket is created and found
/// </summary>
[Test]
@@ -241,6 +242,7 @@ public void When_Flushing_Bucket_Data_Are_Removed()
{
var storedConfig = ConfigurationManager.GetSection("couchbase") as ICouchbaseClientConfiguration;
var config = new CouchbaseClientConfiguration();
+
config.Bucket = "Bucket-" + DateTime.Now.Ticks;
config.Username = storedConfig.Username;
config.Password = storedConfig.Password;
View
4 src/Couchbase.Tests/DefaultCouchbaseClientConfigurationTests.cs
@@ -121,7 +121,7 @@ public void When_Using_Code_Config_And_Http_Client_Factory_Is_Not_Set_Operations
public void When_Using_Code_Config_And_Design_Document_Name_Transformer_Is_Not_Set_Production_Mode_Is_Default()
{
var config = new CouchbaseClientConfiguration();
- config.Urls.Add(new Uri("http://localhost:8091/pools"));
+ config.Urls.Add(new Uri(ConfigurationManager.AppSettings["CouchbaseServerUrl"] + "/pools"));
var client = new CouchbaseClient(config); //client sets up transformer
Assert.That(config.DesignDocumentNameTransformer, Is.InstanceOf<ProductionModeNameTransformer>()); }
@@ -284,7 +284,7 @@ public void When_Http_Client_Timeout_Is_Not_Set_In_App_Config_Default_Is_True()
}
/// <summary>
- /// @test: Default value of Httpclient time out property in HttpClient class from appconfig
+ /// @test: Default value of Httpclient time out property in HttpClient class from appconfig
/// is overwritten if specified
/// @pre: Provide configuration of client in app.config, dont specify timeout
/// @post: Test passes if HttpClient.timeout isas per mentioned in app.config
View
40 src/Couchbase.Tests/HeartbeatConfigTests.cs
@@ -20,10 +20,10 @@ namespace Couchbase.Tests
public class HeartbeatConfigTests : CouchbaseClientTestsBase
{
/// <summary>
- /// @test: Reads the configuration from App.config which enables the heartbeat and then perform
- /// client operations
- /// @pre: Add section named "heartbeat-config-on" in App.config file, enable heartbeat at a specific time interval
- /// @post: Test passes if with heartbeat on, the client can successfully store key-value and then able to get value;
+ /// @test: Reads the configuration from App.config which enables the heartbeat and then perform
+ /// client operations
+ /// @pre: Add section named "heartbeat-config-on" in App.config file, enable heartbeat at a specific time interval
+ /// @post: Test passes if with heartbeat on, the client can successfully store key-value and then able to get value;
/// fails otherwise
/// </summary>
[Test]
@@ -38,14 +38,13 @@ public void Client_Operations_Succeed_When_Heartbeat_Is_Configured()
var getResult = client.ExecuteGet(key);
GetAssertPass(getResult, value);
-
}
/// <summary>
- /// @test: Reads the configuration from App.config which disables the heartbeat and then perform
- /// client operations
+ /// @test: Reads the configuration from App.config which disables the heartbeat and then perform
+ /// client operations
/// @pre: Add section named "heartbeat-config-off" in App.config file, disable heartbeat
- /// @post: Test passes if with heartbeat off, the client can successfully store key-value and then able to get value;
+ /// @post: Test passes if with heartbeat off, the client can successfully store key-value and then able to get value;
/// fails otherwise
/// </summary>
[Test]
@@ -60,31 +59,8 @@ public void Client_Operations_Succeed_When_Heartbeat_Is_Disabled()
var getResult = client.ExecuteGet(key);
GetAssertPass(getResult, value);
-
- }
-
- /// <summary>
- /// @test: Reads the configuration from App.config which has no information on heartbeat and then perform
- /// client operations
- /// @pre: Add section named "min-config" in App.config file, add information about bucket, bucket password, username/password
- /// and server uri.
- /// @post: Test passes if the client can successfully store key-value and then able to get value; fails otherwise
- /// </summary>
- [Test]
- public void Client_Operations_Succeed_When_Heartbeat_Is_Not_Configured()
- {
- var config = ConfigSectionUtils.GetConfigSection<CouchbaseClientSection>("min-config");
- var client = new CouchbaseClient(config);
-
- string key = GetUniqueKey(), value = GetRandomString();
- var storeResult = client.ExecuteStore(StoreMode.Add, key, value);
- StoreAssertPass(storeResult);
-
- var getResult = client.ExecuteGet(key);
- GetAssertPass(getResult, value);
-
}
- }
+ }
}
#region [ License information ]
View
14 src/Couchbase.Tests/HttpClientConfigTests.cs
@@ -15,7 +15,7 @@ public class HttpClientConfigTests : CouchbaseClientViewTestsBase
/// <summary>
/// @test: Reads the configuration of Http client from App.config and gets the view in specified design document
/// @pre: Add section named "httpclient-config-initconn" in App.config file,
- /// set the initializeConnection parameter to true
+ /// set the initializeConnection parameter to true
/// configure all the parameters required to initialize Couchbase client like Uri, bucket, etc.
/// @post: Test passes if successfully gets the view, fails otherwise
/// </summary>
@@ -30,9 +30,9 @@ public void View_Operations_Succeed_When_Initialize_Connection_Is_True()
/// <summary>
/// @test: Reads the configuration of Http client from App.config and gets the view in specified design document
- /// @pre: Add section named "httpclient-config-initconn" in App.config file,
+ /// @pre: Add section named "httpclient-config-initconn" in App.config file,
/// configure all the parameters required to initialize Couchbase client like Uri, bucket, etc.
- /// set the initializeConnection parameter to false
+ /// set the initializeConnection parameter to false
/// @post: Test passes if successfully gets the view, fails otherwise
/// </summary>
[Test]
@@ -42,12 +42,11 @@ public void View_Operations_Succeed_When_Initialize_Connection_Is_False()
var client = new CouchbaseClient(config);
var view = client.GetView<City>("cities", "by_name", true).Stale(StaleMode.False);
- viewPass(view);
-
+ viewPass(view);
}
/// <summary>
- /// @test: when no configuration for Http client is mentioned in App.config,
+ /// @test: when no configuration for Http client is mentioned in App.config,
/// the test would get the view in specified design document
/// @pre: no section in App.config file to initialize client
/// @post: Test passes if successfully gets the view, fails otherwise
@@ -56,8 +55,7 @@ public void View_Operations_Succeed_When_Initialize_Connection_Is_False()
public void View_Operations_Succeed_When_HTTP_Client_Is_Not_Configured_In_App_Config()
{
var view = _Client.GetView<City>("cities", "by_name", true).Stale(StaleMode.False);
- viewPass(view);
-
+ viewPass(view);
}
/// <summary>

0 comments on commit 5ba5287

Please sign in to comment.
Something went wrong with that request. Please try again.