コード例 #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);
            }
コード例 #2
0
            //[ExpectedException(typeof(ApplicationException))]
            public void UnMapThrowExceptionWhenMappingDidntPreviouslyExist()
            {
                Assert.Throws <ApplicationException>(delegate()
                {
                    var target = new FooClassMapper();

                    target.UnMap(p => p.Name);
                });
            }
コード例 #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));
            }
コード例 #4
0
 private static bool MappingExists(FooClassMapper mapper)
 {
     return(mapper.Properties.Count(w => w.Name == "Name") == 1);
 }
コード例 #5
0
            public void UnMapThrowExceptionWhenMappingDidntPreviouslyExist()
            {
                var target = new FooClassMapper();

                target.UnMap(p => p.Name);
            }
コード例 #6
0
 private bool mappingExists(FooClassMapper mapper)
 {
     return(mapper.Properties.Where(w => w.Name == "Name").Count() == 1);
 }