-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKvpTests.cs
More file actions
37 lines (30 loc) · 1.04 KB
/
KvpTests.cs
File metadata and controls
37 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using Microsoft.WindowsAzure.StorageClient;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using JoshCodes.Persistence.Azure.Storage;
namespace JoshCodes.Persistence.Azure.Storage.Testing.Unit
{
[TestClass]
public class KvpTests
{
[TestMethod]
public void TestCreateAndGet()
{
// Setup storage
var tableClient = JoshCodes.Persistence.Azure.Storage.Settings.StorageAccount().CreateCloudTableClient();
var store = new KvpStore(tableClient);
// Setup test values
var container = "KvpTests.TestGetAndSet";
var key = Guid.NewGuid().ToString("N");
var val = Guid.NewGuid().ToString();
// Test empty get
var getVal = store.Get(container, key);
Assert.IsNull(getVal);
// Test Create
store.Create(container, key, val);
// Test Get
getVal = store.Get(container, key);
Assert.AreEqual(val, getVal);
}
}
}