Inheritance: DocumentStore
Exemplo n.º 1
0
 public void GetAllCreatesTheTableIfItDoesNotExist()
 {
     var store = new TestStore();
     using (var session = store.OpenSession())
     {
         var things = session.GetAll<SomeTestClassThatNoOneWillEverUse>().ToList();
         things.Count.ShouldBe(0);
     }
 }
Exemplo n.º 2
0
        public LinqOrderByTests(DocumentStoreBaseFixture data)
        {
            _store = data.TestStore;

            var carA = new Fixture().Build <EntityForLinqOrderByTests>()
                       .With(x => x.PropertyOne, "Mazda")
                       .With(y => y.PropertyTwo, "A")
                       .Create();

            var carB = new Fixture().Build <EntityForLinqOrderByTests>()
                       .With(x => x.PropertyOne, "Mazda")
                       .With(y => y.PropertyTwo, "B")
                       .Create();

            using (var session = _store.OpenSession())
            {
                session.Store(carA);
                session.Store(carB);
                session.SaveChanges();
            }
        }
Exemplo n.º 3
0
        public LinqOrderByTests()
        {
            _testStore = new StoreInfo();
            _store = new TestStore();


            var carA = new Fixture().Build<Car>()
              .With(x => x.Make, "Mazda")
              .With(y => y.Model, "A")
              .Create();

            var carB = new Fixture().Build<Car>()
                .With(x => x.Make, "Mazda")
                .With(y => y.Model, "B")
                .Create();

            using (var session = _store.OpenSession())
            {
                session.Store<Car>(carA);
                session.Store<Car>(carB);
                session.SaveChanges();
            }
        }
Exemplo n.º 4
0
        public void SingleQuotes_ShouldBe_EscapedWhenSaving()
        {
            var car = new Car();
            car.Id = Guid.NewGuid();
            car.Make = "Kia";
            car.Model = "Cee'd";

            var store = new TestStore();
            //save the car
            using (var session = store.OpenSession())
            {
                session.Store(car);
                session.SaveChanges();
            }

            //retrieve and check the make and model are correct
            using (var session = store.OpenSession())
            {
                var savedCar = session.GetById<Car>(car.Id);
                savedCar.Model.ShouldBe("Cee'd");
                savedCar.Make.ShouldBe("Kia");

            }
        }
Exemplo n.º 5
0
 public SessionAndStoreTests(DocumentStoreBaseFixture data)
 {
     _store = data.TestStore;
 }
Exemplo n.º 6
0
 public DocumentStoreBaseFixture()
 {
     TestStore = new TestStore();
 }
Exemplo n.º 7
0
 public DocumentStoreBaseFixture()
 {
     TestStore = new TestStore();
 }
Exemplo n.º 8
0
 public CorrectEscapingTests(DocumentStoreBaseFixture data)
 {
     _store = data.TestStore;
 }
Exemplo n.º 9
0
 public GetAllTests(DocumentStoreBaseFixture data)
 {
     _store = data.TestStore;
 }