//[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); }
//[ExpectedException(typeof(ApplicationException))] public void UnMapThrowExceptionWhenMappingDidntPreviouslyExist() { Assert.Throws <ApplicationException>(delegate() { var target = new FooClassMapper(); target.UnMap(p => p.Name); }); }
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)); }
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); }