public void GetAllCreatesTheTableIfItDoesNotExist() { var store = new TestStore(); using (var session = store.OpenSession()) { var things = session.GetAll<SomeTestClassThatNoOneWillEverUse>().ToList(); things.Count.ShouldBe(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(); } }
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(); } }
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"); } }
public SessionAndStoreTests(DocumentStoreBaseFixture data) { _store = data.TestStore; }
public DocumentStoreBaseFixture() { TestStore = new TestStore(); }
public CorrectEscapingTests(DocumentStoreBaseFixture data) { _store = data.TestStore; }
public GetAllTests(DocumentStoreBaseFixture data) { _store = data.TestStore; }