GetWriteConcern() public method

Returns a WriteConcern value based on this instance's settings and a default enabled value.
public GetWriteConcern ( bool enabledDefault ) : WriteConcern
enabledDefault bool The default enabled value.
return WriteConcern
 public void TestGetWriteConcern_W(bool acknowledgedDefault, bool acknowledged, object wobj, string connectionString)
 {
     var w = (wobj == null) ? null : (wobj is int) ? (WriteConcern.WValue)new WriteConcern.WCount((int)wobj) : new WriteConcern.WMode((string)wobj);
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(acknowledgedDefault);
     Assert.AreEqual(acknowledged, writeConcern.IsAcknowledged);
     Assert.AreEqual(w, writeConcern.W);
 }
 public void TestGetWriteConcern_WTimeout(int? ms, string connectionString)
 {
     var wtimeout = (ms == null) ? (TimeSpan?)null : TimeSpan.FromMilliseconds(ms.Value);
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(true);
     Assert.AreEqual(wtimeout, writeConcern.WTimeout);
 }
 public void TestGetWriteConcern_FSync(bool? fsync, string connectionString)
 {
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(true);
     Assert.AreEqual(fsync, writeConcern.FSync);
 }
 public void TestGetWriteConcern_IsAcknowledged(bool acknowledgedDefault, bool acknowledged, string connectionString)
 {
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(acknowledgedDefault);
     Assert.AreEqual(acknowledged, writeConcern.IsAcknowledged);
 }
 public void TestGetWriteConcern_Enabled(bool enabledDefault, bool enabled, string connectionString)
 {
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(enabledDefault);
     Assert.AreEqual(enabled, writeConcern.Enabled);
 }
 public void TestGetWriteConcern_W(object obj, string connectionString)
 {
     var w = (obj is int) ? (WriteConcern.WValue)(int)obj : (WriteConcern.WValue)(string)obj;
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(false);
     Assert.AreEqual(w, writeConcern.W);
 }
 public void TestGetWriteConcern_FireAndForget(bool fireAndForgetDefault, bool fireAndForget, string connectionString)
 {
     var builder = new MongoUrlBuilder(connectionString);
     var writeConcern = builder.GetWriteConcern(fireAndForgetDefault);
     Assert.AreEqual(fireAndForget, writeConcern.FireAndForget);
 }