Ejemplo n.º 1
0
        public void Should_Be_Able_To_Run_Query()
        {
            //Arrange
            var sessionFactory = TastFactory.CreateSessionFactory();
            var target         = new DataContext(sessionFactory.OpenSession());

            //Act
            var result = new FindFoo().Execute(target).ToList();

            //Assert
            Assert.IsTrue(result.Any());
        }
Ejemplo n.º 2
0
        public void ShouldReturnAnUpdatedObject()
        {
            //Arrange
            var sessionFactory = TastFactory.CreateSessionFactory();
            var target         = new DataContext(sessionFactory.OpenSession());

            //Act
            var item = new Foo();

            target.Add(item);
            target.Commit();

            //Assert
            Assert.IsNotNull(item.Id);
            Assert.AreNotEqual(default(int), item.Id);
            Console.WriteLine(item.Id);
        }