public static void Dependency(string expected, string username) { // Arrange // Act var result = HistoryLogKeyHelper.Dependency(username); // Assert Assert.Equal(expected, result); }
public static void Specification_DateRange(string expected, string from, string to) { // Arrange var spec = new HistoryLogSpecification() { DateRange = new Range <DateTime>(DateTime.Parse(from, CultureInfo.InvariantCulture), DateTime.Parse(to, CultureInfo.InvariantCulture)) }; // Act var result = HistoryLogKeyHelper.Specification(spec); // Assert Assert.Equal(expected, result); }
public static void Specification_Events(string expected, string events) { // Arrange var spec = new HistoryLogSpecification() { DateRange = new Range <DateTime>(new DateTime(2011, 02, 13), new DateTime(2011, 02, 14)), Events = events.Split(';').Translate(s => Int16.Parse(s, CultureInfo.InvariantCulture)).ToArray() }; // Act var result = HistoryLogKeyHelper.Specification(spec); // Assert Assert.Equal(expected, result); }
public static void Specification_EventId(string expected, int eventid) { // Arrange var spec = new HistoryLogSpecification() { DateRange = new Range <DateTime>(new DateTime(2011, 02, 13), new DateTime(2011, 02, 14)), EventId = (short)eventid }; // Act var result = HistoryLogKeyHelper.Specification(spec); // Assert Assert.Equal(expected, result); }
public static void Specification_Username(string expected, string username) { // Arrange var spec = new HistoryLogSpecification() { Username = username, DateRange = new Range <DateTime>(new DateTime(2011, 02, 13), new DateTime(2011, 02, 14)) }; // Act var result = HistoryLogKeyHelper.Specification(spec); // Assert Assert.Equal(expected, result); }
private LinkedCacheDependency HistoryDependency(string username) { var key = string.Concat(Keyspace, HistoryLogKeyHelper.Dependency(username)); return(new LinkedCacheDependency(m_cache, key, DateTime.Now.Add(HistoryLifetime))); }
public override IDictionary <short, HistoryLogEvent> MapEvents(string languageCode) { var key = string.Concat(Keyspace, HistoryLogKeyHelper.MapEvents(languageCode)); return(DefaultCache.Instance.Get(key, () => base.MapEvents(languageCode), EventsLifetime)); }
public override IEnumerable <HistoryLogEvent> ListEvents(string languageCode) { var key = string.Concat(Keyspace, HistoryLogKeyHelper.ListEvents(languageCode)); return(DefaultCache.Instance.Get(key, () => base.ListEvents(languageCode), EventsLifetime)); }