public void Fetch() { var serializer = new JsonSerializer(); var db = new SimpleDBDataStore(); var responseItems = db.Fetch(_storeIdentifier, _itemKey); var employees = new List <Employee>(responseItems.Count()); foreach (var responseItem in responseItems) { var employee = serializer.Deserialize(typeof(Employee), responseItem) as Employee; Assert.IsNotNull(employee); employees.Add(employee); } }
public void Add() { var employees = GetEmployees(DateTime.Now.AddHours(-1)); var serializer = new JsonSerializer(); var db = new SimpleDBDataStore(); var serializedEmployees = new List <string>(employees.Count()); foreach (var employee in employees) { var serializedEmployee = serializer.Serialize(typeof(Employee), employee).ToString(); serializedEmployees.Add(serializedEmployee); } db.Add(_storeIdentifier, _itemKey, serializedEmployees.ToArray()); }
public void Flush() { var db = new SimpleDBDataStore(); db.Flush(_storeIdentifier); }