public async void When_Add_Succeeds_InsertAsync_Returns_Success() { var connection = new FakeConnection(); connection.SetResponse(ResponsePackets.ADD_SUCCESS); _connectionPool.AddConnection(connection); var bucket = GetBucketForKey("key1"); var result = await bucket.InsertAsync("key1", "NA"); Assert.IsTrue(result.Success); Assert.AreEqual(ResponseStatus.Success, result.Status); }
public async void When_Key_Is_Found_GetAsync_Returns_True() { var connection = new FakeConnection(); connection.SetResponse(ResponsePackets.GET_OPAQUE_5_SUCCESS); _connectionPool.AddConnection(connection); var bucket = GetBucketForKey("key1"); var result = await bucket.GetAsync <int>("key1"); Assert.IsTrue(result.Success); Assert.AreEqual(ResponseStatus.Success, result.Status); }