public DataCleaner(NameValueCollection c) { Initialize(c); ForceValidation = false; _db = new DataCleanRespository(); _msgDict = new ParseResultDictionary(_db.GetMelissaReference()); }
public void CanGetParseDictionaryWarningsTest() { var db = new DataCleanRespository(); var msgDict = new ParseResultDictionary(db.GetMelissaReference()); Assert.IsTrue(msgDict.GetAllWarningMessages().Count() > 3); }
public void CanGetParseDictionaryTest() { var db = new DataCleanRespository(); var msgDict = new ParseResultDictionary(db.GetMelissaReference()); Assert.IsTrue(msgDict.Count > 300); }
public void CanDoLookupTest() { var db = new DataCleanRespository(); var msgDict = new ParseResultDictionary(db.GetMelissaReference()); var c = msgDict.LookupCode(PostalCodeErrorCode); Assert.IsTrue(c.Code == PostalCodeErrorCode); Assert.IsTrue(c.LongDescription.Length > 0 ); }
public void CantSaveOutputDoesNotMatchInputTest() { var db = new DataCleanRespository(); var e = new DataCleanEvent() { Input = TestData.GoodAddresstoClean, DataCleanDate = DateTime.Now, Output = _goodOutputStreetAddress }; // output id does not match input var id = e.ID; try { db.SaveEvent(e); } catch (Exception ex) { Assert.IsTrue(ex.Message.Contains("id")); } }
public void CantSaveUncleanEventTest() { var db = new DataCleanRespository(); var e = new DataCleanEvent() { Input = TestData.GoodAddresstoClean //DataCleanDate = DateTime.Now // We dont want to save an event without a data clean date! }; var id = e.ID; try { db.SaveEvent(e); } catch( Exception ex) { Assert.IsTrue(ex.Message.Contains("date")); } }
public void CanSaveEventTest() { var testTime = DateTime.Now; var db = new DataCleanRespository(); var e = new DataCleanEvent() { Input = TestData.GoodAddresstoClean, DataCleanDate = testTime, Output = _goodOutputStreetAddress }; // if the output id does not match it will not resolve correctly when we combine the two after datacleaner is done // e.Output.ID = e.ID; var id = e.ID; db.SaveEvent(e); var d = db.GetEvent(e.ID); Assert.IsTrue(d.ID == e.ID); Assert.IsTrue(d.Output.ID == e.ID); Assert.IsTrue(d.Output.ID == e.Input.ID); Assert.IsTrue(d.DataCleanDate == testTime); }
public void CantSaveEmptyEventTest() { var db = new DataCleanRespository(); var e = new DataCleanEvent(); var id = e.ID; try { db.SaveEvent(e); } catch (Exception ex) { Assert.IsTrue(ex.Message.Contains("event")); } }
public void CantSaveWithoutOutputTest() { var db = new DataCleanRespository(); var e = new DataCleanEvent() { DataCleanDate = DateTime.Now, Input = TestData.GoodAddresstoClean }; var id = e.ID; try { db.SaveEvent(e); } catch (Exception ex) { Assert.IsTrue(ex.Message.Contains("output")); } }