コード例 #1
0
        public void EntityContext_AddEntity_Success_Test()
        {
            var handler = new FakeEntityContext(new FakeEntity());

            const bool expected = true;
            var        actual   = handler.AddEntity(new FakeEntity());

            actual.Should().Be(expected);
        }
コード例 #2
0
        public void EntityContext_AddEntity_AlreadyExists_Test()
        {
            var entity  = new FakeEntity();
            var handler = new FakeEntityContext(new FakeEntity());

            handler.AddEntity(entity);

            const bool expected = true;
            var        actual   = handler.Contains(entity);

            actual.Should().Be(expected);
        }
コード例 #3
0
        public void EntityContext_ContainsId_Success_Test()
        {
            const long id = 1;

            var entity = new FakeEntity {
                ID = id
            };
            var handler = new FakeEntityContext(new FakeEntity());

            handler.AddEntity(entity);

            const bool expected = true;
            var        actual   = handler.Contains(id);

            actual.Should().Be(expected);
        }