Guest User

Untitled

a guest
Feb 7th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using Freelancers.Infrastructure.Storage;
  3. using Xunit;
  4.  
  5. namespace Freelancers.Infrastructure.Tests.Storage
  6. {
  7.     public class CacheStorageFacts
  8.     {
  9.     private CacheStorage cacheStorage;
  10.  
  11.     [SetUp]
  12.     public void SetUp()
  13.     {
  14.         cacheStorage = new CacheStorage();
  15.     }
  16.  
  17.         [Fact]
  18.         public void Remove_WithEmptyKey_ThrowsArgumentException()
  19.         {
  20.             Assert.Throws<ArgumentException>(() => cacheStorage.Remove(""));
  21.         }
  22.  
  23.         [Fact]
  24.         public void Store_WithEmptyKeyThrowsArgumentException()
  25.         {
  26.             Assert.Throws<ArgumentException>(() => cacheStorage.Store("", "test"));
  27.         }
  28.  
  29.         [Fact]
  30.         public void Store_WithNullDataThrowsArgumentException()
  31.         {
  32.             Assert.Throws<ArgumentNullException>(() => cacheStorage.Store("test", null));
  33.         }
  34.  
  35.         [Fact]
  36.         public void Retrieve_WithEmptyKeyThrowsArgumentException()
  37.         {
  38.             Assert.Throws<ArgumentException>(() => cacheStorage.Retrieve<object>(""));
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment