Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#102 Added another test for the Caching service
Browse files Browse the repository at this point in the history
Chris Morris committed Jan 14, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
SWvheerden SW van Heerden
1 parent d365bd5 commit f55ba27
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -37,8 +37,8 @@ public CachingServiceTests()
}

[Theory]
[InlineData("02443b12-70c2-4166-9b8b-a6b25b1ce8f2", "Test String Number 1 - She Sells Sea Shells on the Sea Shore")]
[InlineData("23310df5-c0e3-4f0b-a7ac-bb7a8286d66b", "Test String Number 2 - Peter Piper Picked a Peck of Pickled Peppers")]
[InlineData("02443b12-70c2-4166-9b8b-a6b25b1ce8f2", "0PPTPuTagb2R0vP3QnHe")]
[InlineData("23310df5-c0e3-4f0b-a7ac-bb7a8286d66b", "PXliG79vPg0B2jX156YW")]
public void SetAndGetCacheItem(string key, string value)
{
var byteValue = Encoding.ASCII.GetBytes(value);
@@ -48,5 +48,17 @@ public void SetAndGetCacheItem(string key, string value)
Assert.NotEmpty(cacheItem);
Assert.Equal(value, cacheItemAsString);
}

[Theory]
[InlineData("e2ab7f0a-1034-4833-8a9d-5e42320bda40", "kRdmZN2zPtJWk54fb6Np")]
[InlineData("7745951c-7dd2-42fe-aeca-0848db372c86", "i6EEzp61U0wt5ACfxk2X")]
public void SetAndDeleteCacheItem(string key, string value)
{
var byteValue = Encoding.ASCII.GetBytes(value);
_cachingService.SetCacheItem(key, byteValue, _cacheEntryOptions);
_cachingService.DeleteCacheItem(key);
var cacheItem = _cachingService.GetCacheItem(key);
Assert.Null(cacheItem);
}
}
}

0 comments on commit f55ba27

Please sign in to comment.