DefconDotNet

Untitled

Feb 7th, 2012
113
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 static CacheStorage _cacheStorage;
  10.  
  11.         public CacheStorageFacts()
  12.         {
  13.             _cacheStorage = new CacheStorage();
  14.         }
  15.  
  16.         public class Remove
  17.         {
  18.             [Fact]
  19.             public void WithEmptyKeyThrowsArgumentException()
  20.             {
  21.                 Assert.Throws<ArgumentException>(() => _cacheStorage.Remove(""));
  22.             }
  23.         }
  24.  
  25.         public class Store
  26.         {
  27.             [Fact]
  28.             public void WithEmptyKeyThrowsArgumentException()
  29.             {
  30.                 Assert.Throws<ArgumentException>(() => _cacheStorage.Store("", "test"));
  31.             }
  32.             [Fact]
  33.             public void WithNullDataThrowsArgumentException()
  34.             {
  35.                 Assert.Throws<ArgumentNullException>(() => _cacheStorage.Store("test", null));
  36.             }
  37.         }
  38.  
  39.         public class Retrieve
  40.         {
  41.             [Fact]
  42.             public void WithEmptyKeyThrowsArgumentException()
  43.             {
  44.                 Assert.Throws<ArgumentException>(() => _cacheStorage.Retrieve<object>(""));
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment