public void Get_String_ReturnsValue() { // Arrange var client = new FakeCouchbaseClient(); client.Store(StoreMode.Add, "some_key", "my value"); // Act var result = client.Get <string>("some_key"); // Assert Assert.That(result, Is.EqualTo("my value")); }
public void Remove_ExistingItem_ReturnsSuccess() { // Arrange var client = new FakeCouchbaseClient(); client.Store(StoreMode.Add, "my_key", "some value"); // Act var result = client.Remove("my_key"); // Assert Assert.That(result, Is.True); }
public void ExecuteRemove_ExistingItem_ReturnsSuccess() { // Arrange var client = new FakeCouchbaseClient(); client.Store(StoreMode.Add, "my_key", "some value"); // Act var result = client.ExecuteRemove("my_key"); // Assert Assert.That(result.Success, Is.True); Assert.That(result.StatusCode, Is.EqualTo((int)StatusCode.Success)); }
public void ExecuteRemove_ExistingItem_ReturnsSuccess() { // Arrange var client = new FakeCouchbaseClient(); client.Store(StoreMode.Add, "my_key", "some value"); // Act var result = client.ExecuteRemove("my_key"); // Assert Assert.That(result.Success, Is.True); Assert.That(result.StatusCode, Is.EqualTo((int)StatusCode.Success)); }
public void Touch_ExistingItem_UpdatesExpiration() { // Arrange var server = new CouchbaseServer(); var client = new FakeCouchbaseClient(server); client.Store(StoreMode.Add, "my_key", "some value"); var expiresAt = DateTime.Now.AddMinutes(3); // Act client.Touch("my_key", expiresAt); // Assert Assert.That(server.GetItem("my_key").Expiration, Is.EqualTo(expiresAt)); }
public void Touch_ExistingItem_UpdatesExpiration() { // Arrange var server = new CouchbaseServer(); var client = new FakeCouchbaseClient(server); client.Store(StoreMode.Add, "my_key", "some value"); var expiresAt = DateTime.Now.AddMinutes(3); // Act client.Touch("my_key", expiresAt); // Assert Assert.That(server.GetItem("my_key").Expiration, Is.EqualTo(expiresAt)); }
public void Remove_ExistingItem_ReturnsSuccess() { // Arrange var client = new FakeCouchbaseClient(); client.Store(StoreMode.Add, "my_key", "some value"); // Act var result = client.Remove("my_key"); // Assert Assert.That(result, Is.True); }
public void Get_String_ReturnsValue() { // Arrange var client = new FakeCouchbaseClient(); client.Store(StoreMode.Add, "some_key", "my value"); // Act var result = client.Get<string>("some_key"); // Assert Assert.That(result, Is.EqualTo("my value")); }