public TokenizedWriterTests() { var s = StringTokenProviderEx.Sequential(); s.Add(StringTokenEx.String("test", "1")); s.Add(StringTokenEx.DateTime("dt", _dt)); _provider = s; }
public void CombinedCombines() { var s1 = StringTokenProviderEx.Sequential(); var s2 = StringTokenProviderEx.Sequential(); var c = StringTokenProviderEx.Combine(s1, s2); Assert.Equal(0, c.Count()); var test1 = StringTokenEx.String("test", "1"); s2.Add(test1); Assert.True(c.SequenceEqual(new[] { test1 })); Assert.Equal(test1, c.Get("test")); var test2 = StringTokenEx.String("test", "2"); s1.Add(test2); Assert.True(c.SequenceEqual(new[] { test2, test1 })); Assert.Equal(test2, c.Get("test")); var other = StringTokenEx.String("other", "3"); s2.Upsert(other); Assert.Equal(test2, c.Get("test")); Assert.Equal(other, c.Get("other")); Assert.True(c.OrderBy(x => x.Name).SequenceEqual(new[] { other, test2, test1 })); }
public void SequentialOk() { StorageOk(StringTokenProviderEx.Sequential()); }