Exemplo n.º 1
0
            public void should_mark_as_deleted()
            {
                //arrange
                A.CallTo(() => SessionScope.GetById <int, TestEntity>(4)).Returns(new TestEntity()
                {
                    Id = 4, Field = "Super"
                });

                //act
                Repository.Delete(4);

                //assert
                A.CallTo(() => SessionScope.MarkAsDeleted(A <TestEntity> .That.Matches(t => t.Id == 4 && t.Field == "Super"))).MustHaveHappened();
            }
Exemplo n.º 2
0
            public void should_get_it()
            {
                //arrange
                A.CallTo(() => SessionScope.GetById <int, TestEntity>(4)).Returns(new TestEntity()
                {
                    Id = 4, Field = "Super"
                });

                //act
                var result = Repository.GetById(4);

                //assert
                result.Id.Should().Be(4);
                result.Field.Should().Be("Super");
            }