public IActionResult Input(int id, CacheDirection?direction, [FromBody] string input) { // By making the enum nullable, the binder will return a 404 when neither of the enum values is passed string decodedJson = DecodingHelper.Decode(input.ToString()); CachingHelper.Add(id, decodedJson, direction.Value); return(Ok()); }
public void AddAndGetItemInLRightStore() { CachingHelper.Add(1, "zxcvb", CacheDirection.RIGHT); Assert.Equal("zxcvb", CachingHelper.Get(1, CacheDirection.RIGHT)); }
public void AddAndGetItemInLeftStore() { CachingHelper.Add(1, "asdfg", CacheDirection.LEFT); Assert.Equal("asdfg", CachingHelper.Get(1, CacheDirection.LEFT)); }