Beispiel #1
0
        public void throw_if_custom_id_property_doesnt_exist([ShortStrings] string value)
        {
            var entity = new NoIdEntity();

            Assert.That(() =>
            {
                EntityManagerFactory.Create(entity, value, _pump.Object);
            }, Throws.InstanceOf <ArgumentOutOfRangeException>());
        }
        public void should_set_entity_with_no_id_fields()
        {
            var entity  = new NoIdEntity();
            var adapter = new EntityAdapter <NoIdEntity>(entity, NoIdMap);

            adapter.SetValues(NoIdEntityValues);

            entity.Name.ShouldEqual(EntityValues["col_name"]);
            entity.Values.Count.ShouldEqual(3);
            entity.Values["CompanyName"].ShouldEqual(EntityValues["col_companyname"]);
            entity.Values["OptOut"].ShouldEqual(EntityValues["col_optout"]);
            entity.Values["OptOutDate"].ShouldEqual(EntityValues["col_optoutdate"]);
        }