Пример #1
0
        public void Touch_NonExistingItem_DoesNothing()
        {
            // Arrange
            var server = new CouchbaseServer();
            var client = new FakeCouchbaseClient(server);

            var expiresAt = DateTime.Now.AddMinutes(3);

            // Act
            client.Touch("my_key", expiresAt);

            // Assert
            Assert.That(server.ItemExists("my_key"), Is.False);
        }
Пример #2
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_NonExistingItem_DoesNothing()
        {
            // Arrange
            var server = new CouchbaseServer();
            var client = new FakeCouchbaseClient(server);

            var expiresAt = DateTime.Now.AddMinutes(3);

            // Act
            client.Touch("my_key", expiresAt);

            // Assert
            Assert.That(server.ItemExists("my_key"), Is.False);
        }
        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));
        }