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
- {
- public class Remove
- {
- [Fact]
- public void WithEmptyKeyThrowsArgumentException()
- {
- // Arrange
- var cacheStorage = new CacheStorage();
- // Act
- // Assert
- Assert.Throws<ArgumentException>(() => cacheStorage.Remove(""));
- }
- }
- public class Store
- {
- [Fact]
- public void WithEmptyKeyThrowsArgumentException()
- {
- // Arrange
- var cacheStorage = new CacheStorage();
- // Act
- // Assert
- Assert.Throws<ArgumentException>(() => cacheStorage.Store("", "test"));
- }
- [Fact]
- public void WithNullDataThrowsArgumentException()
- {
- // Arrange
- var cacheStorage = new CacheStorage();
- // Act
- // Assert
- Assert.Throws<ArgumentNullException>(() => cacheStorage.Store("test", null));
- }
- }
- public class Retrieve
- {
- [Fact]
- public void WithEmptyKeyThrowsArgumentException()
- {
- // Arrange
- var cacheStorage = new CacheStorage();
- // Act
- // Assert
- Assert.Throws<ArgumentException>(() => cacheStorage.Retrieve<object>(""));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment