public void CleanAddresses_TwoMessyAddressesSentIn_SameNumberOfCleanAddessesReturned() { // Arrange var messyAddresses = new List <MessyAddressInformation>(); messyAddresses.Add(new MessyAddressInformation()); messyAddresses.Add(new MessyAddressInformation()); // Act var classToTest = new MessyListToCleanList(); var result = classToTest.CleanAddresses(messyAddresses); // Assert result.Count.ShouldBe(2); }
public void CleanAddresses_MessyAddressHasNameWithOnlyFirstName_FirstNameHasSentInValue() { // Arrange var name = "Matthew"; var messyAddresses = new List <MessyAddressInformation>(); messyAddresses.Add(new MessyAddressInformation { Name = name }); // Act var classToTest = new MessyListToCleanList(); var result = classToTest.CleanAddresses(messyAddresses); // Assert result.Any(x => x.FirstName == "Matthew").ShouldBe(true); }
public void CleanAddresses_MessyAddressHasName_SplitsNameOnSpacesAndStoresCorrentValueIntoLastName() { // Arrange var name = "Matthew Puneky"; var messyAddresses = new List <MessyAddressInformation>(); messyAddresses.Add(new MessyAddressInformation { Name = name }); // Act var classToTest = new MessyListToCleanList(); var result = classToTest.CleanAddresses(messyAddresses); // Assert result.Any(x => x.LastName == "Puneky").ShouldBe(true); }
public void CleanAddresses_MessyAddressHasAddressOfNothing_ZipCodeHasValueOfNA() { // Arrange var address = ""; var messyAddresses = new List <MessyAddressInformation>(); messyAddresses.Add(new MessyAddressInformation { Address = address }); // Act var classToTest = new MessyListToCleanList(); var result = classToTest.CleanAddresses(messyAddresses); // Assert result.Any(x => x.ZipCode == "N/A").ShouldBe(true); }
public void CleanAddresses_MessyAddressHasAddress_SplitsAdressOnCommasAndStoresCorrentValueIntoZipCode() { // Arrange var address = "42 Foo Dr., Some City, NY, 98210"; var messyAddresses = new List <MessyAddressInformation>(); messyAddresses.Add(new MessyAddressInformation { Address = address }); // Act var classToTest = new MessyListToCleanList(); var result = classToTest.CleanAddresses(messyAddresses); // Assert result.Any(x => x.ZipCode == "98210").ShouldBe(true); }
public void CleanAddresses_MessyAddressHasNameOfNothing_LastNameHasValueOfNA() { // Arrange var name = ""; var messyAddresses = new List <MessyAddressInformation>(); messyAddresses.Add(new MessyAddressInformation { Name = name }); // Act var classToTest = new MessyListToCleanList(); var result = classToTest.CleanAddresses(messyAddresses); // Assert result.Any(x => x.LastName == "N/A").ShouldBe(true); }