Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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"));
        }