public void every_entity_has_unique_identity()
        {
            var entity = new FakeEntity();
            var otherEntity = new FakeEntity();

            _dataSource.Add(entity);
            _dataSource.Add(otherEntity);

            Assert.AreNotEqual(entity.Id, otherEntity.Id);
        }
Exemplo n.º 2
0
        public void CollectBrokenRules_checks_associated_rules_against_specified_entity()
        {
            _rp.AddRule<FakeEntity>(new Rule<FakeEntity>(e => e.PropertyFake <= 10));
            _rp.AddRule<FakeEntity>(new Rule<FakeEntity>(e => e.PropertyFake >= 5));
            var rules = _rp.GetRules<FakeEntity>();
            var entity = new FakeEntity();
            entity.PropertyFake = 11;

            var brokenRules = _rp.CollectBrokenRules<FakeEntity>(entity);
            Assert.AreEqual(1, brokenRules.Count());
        }
 public void can_add_entity()
 {
     var entity = new FakeEntity();
     _dataSource.Add(entity);
     Assert.AreEqual(entity, _dataSource.Last());
 }
Exemplo n.º 4
0
 public When_checking_rule()
 {
     _rule = new Rule<FakeEntity>(e => e.PropertyFake <= 10);
     _entity = new FakeEntity();
 }