Esempio n. 1
0
            //[ExpectedException(typeof(ApplicationException))]
            public void UnMapThrowExceptionWhenMappingDidntPreviouslyExist()
            {
                var target = new FooClassMapper();

                var ex = Assert.Throws <ApplicationException>(() => target.UnMap(p => p.Name));

                StringAssert.Contains("mapping does not exist", ex.Message);
            }
Esempio n. 2
0
            //[ExpectedException(typeof(ApplicationException))]
            public void UnMapThrowExceptionWhenMappingDidntPreviouslyExist()
            {
                Assert.Throws <ApplicationException>(delegate()
                {
                    var target = new FooClassMapper();

                    target.UnMap(p => p.Name);
                });
            }
Esempio n. 3
0
            public void UnMapRemovesAnExistingMapping()
            {
                var target = new FooClassMapper();

                target.Map(p => p.Name);
                Assert.IsTrue(MappingExists(target));

                target.UnMap(p => p.Name);
                Assert.IsFalse(MappingExists(target));
            }
Esempio n. 4
0
 private static bool MappingExists(FooClassMapper mapper)
 {
     return(mapper.Properties.Count(w => w.Name == "Name") == 1);
 }
            public void UnMapThrowExceptionWhenMappingDidntPreviouslyExist()
            {
                var target = new FooClassMapper();

                target.UnMap(p => p.Name);
            }
 private bool mappingExists(FooClassMapper mapper)
 {
     return(mapper.Properties.Where(w => w.Name == "Name").Count() == 1);
 }