/
BootstrapEnabledTests.cs
38 lines (34 loc) · 1.16 KB
/
BootstrapEnabledTests.cs
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
38
using System;
using Autofac;
using BinaryAnalysis.Data.Box;
using BinaryAnalysis.Data.Versioning;
using BinaryAnalysis.Tests.Helpers;
using BinaryAnalysis.Tests.Helpers.Entities;
using NUnit.Framework;
namespace BinaryAnalysis.Tests.Data
{
[TestFixture]
public class BootstrapEnabledTests : TestBootstrapEnabledTests
{
[Test]
public void TestRepoFinder()
{
var finder = Container.Resolve<RepositoryFinder>();
Type clRepo = finder.CreateRepository<TestEntity>().GetType();
Assert.AreEqual(clRepo, typeof(TrackableRepository<TestEntity>));
}
[Test]
public void TestMultisession()
{
var testRepo = Container.Resolve<TestRepository>();
var entity = new TestEntity() { Name = "test1", Name2 = "asd1" };
testRepo.Save(entity);
testRepo.Evict(entity);
testRepo = Container.Resolve<TestRepository>();
testRepo.Delete(entity);
Assert.IsNull(testRepo.Get(entity.Id));
testRepo = Container.Resolve<TestRepository>();
Assert.IsNull(testRepo.Get(entity.Id));
}
}
}