View difference between Paste ID: zpibCBLf and 9cC7n238
SHOW: | | - or go back to the newest paste.
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;
9+
        private static CacheStorage _cacheStorage;
10
11-
	[SetUp]
11+
        public CacheStorageFacts()
12-
	public void SetUp()
12+
13-
	{
13+
            _cacheStorage = new CacheStorage();
14-
	    cacheStorage = new CacheStorage();
14+
15-
	}
15+
 
16
        public class Remove
17-
        [Fact]
17+
18-
        public void Remove_WithEmptyKey_ThrowsArgumentException()
18+
            [Fact]
19
            public void WithEmptyKeyThrowsArgumentException()
20-
            Assert.Throws<ArgumentException>(() => cacheStorage.Remove(""));
20+
            {
21
                Assert.Throws<ArgumentException>(() => _cacheStorage.Remove(""));
22
            }
23-
        [Fact]
23+
24-
        public void Store_WithEmptyKeyThrowsArgumentException()
24+
25
        public class Store
26-
            Assert.Throws<ArgumentException>(() => cacheStorage.Store("", "test"));
26+
27
            [Fact]
28
            public void WithEmptyKeyThrowsArgumentException()
29-
        [Fact]
29+
            {
30-
        public void Store_WithNullDataThrowsArgumentException()
30+
                Assert.Throws<ArgumentException>(() => _cacheStorage.Store("", "test"));
31
            }
32-
            Assert.Throws<ArgumentNullException>(() => cacheStorage.Store("test", null));
32+
            [Fact]
33
            public void WithNullDataThrowsArgumentException()
34
            {
35-
        [Fact]
35+
                Assert.Throws<ArgumentNullException>(() => _cacheStorage.Store("test", null));
36-
        public void Retrieve_WithEmptyKeyThrowsArgumentException()
36+
            }
37
        }
38-
            Assert.Throws<ArgumentException>(() => cacheStorage.Retrieve<object>(""));
38+
39
        public class Retrieve
40
        {
41
            [Fact]
42
            public void WithEmptyKeyThrowsArgumentException()
43
            {
44
                Assert.Throws<ArgumentException>(() => _cacheStorage.Retrieve<object>(""));
45
            }
46
        }
47
    }
48
}