Пример #1
0
        public void TestConfigWorks()
        {
            var config = new TestConfiguration();

            using (var session = new InMemoryDatabase(config).BeginSession()) {
                session.Insert(new Post()
                {
                    Title = "Foo"
                });
                Assert.Equal("Foo", session.Get <Post>(1).Title);
            }
        }
Пример #2
0
 public void Update(TData data)
 {
     InMemoryDatabase.Get <TData>()[data.Rsn] = data;
 }
Пример #3
0
 public void RemoveAll()
 {
     InMemoryDatabase.Get <TData>().Clear();
 }
Пример #4
0
 public void Destroy(TData data)
 {
     InMemoryDatabase.Get <TData>().Remove(data.Rsn);
 }
Пример #5
0
 /// <summary>
 /// Will mark the <paramref name="data"/> as logically (or soft) by setting <see cref="Entity.IsLogicallyDeleted"/> to true
 /// </summary>
 public void Remove(TData data)
 {
     InMemoryDatabase.Get <TData>()[data.Rsn].IsLogicallyDeleted = true;
 }
Пример #6
0
 public void Add(TData data)
 {
     InMemoryDatabase.Get <TData>().Add(data.Rsn, data);
 }
Пример #7
0
 public ArticleCommentServiceTests()
 {
     this.db = InMemoryDatabase.Get();
     AutomapperInitializer.Initialize();
 }