Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Freelancers.Infrastructure.Storage;
- using Xunit;
- namespace Freelancers.Infrastructure.Tests.Storage
- {
- public class CacheStorageFacts
- {
- private CacheStorage cacheStorage;
- [SetUp]
- public void SetUp()
- {
- cacheStorage = new CacheStorage();
- }
- [Fact]
- public void Remove_WithEmptyKey_ThrowsArgumentException()
- {
- Assert.Throws<ArgumentException>(() => cacheStorage.Remove(""));
- }
- [Fact]
- public void Store_WithEmptyKeyThrowsArgumentException()
- {
- Assert.Throws<ArgumentException>(() => cacheStorage.Store("", "test"));
- }
- [Fact]
- public void Store_WithNullDataThrowsArgumentException()
- {
- Assert.Throws<ArgumentNullException>(() => cacheStorage.Store("test", null));
- }
- [Fact]
- public void Retrieve_WithEmptyKeyThrowsArgumentException()
- {
- Assert.Throws<ArgumentException>(() => cacheStorage.Retrieve<object>(""));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment