public void Reset_ShouldEmptyTrie() { //Arrange var trie = new Domain.Models.DataStructure.Trie(); trie.Insert(new Location { Name = "Amos", Latitude = -43.0987, Longitude = 127.6782, Country = "CA", AdministrativeRegion = "10", Population = 25000 }); //Act trie.Reset(); //Assert var isEmpty = trie.IsEmpty(); isEmpty.ShouldSatisfyAllConditions( () => isEmpty.ShouldBeTrue() ); }
public void GetSuggestionsForPrefix_ShouldReturnTwoLocations_ForSameName() { //Arrange var trie = new Domain.Models.DataStructure.Trie(); var values = new List <Location> { new Location { Name = "Carleton", Latitude = -43.0987, Longitude = 127.6782, Country = "CA", AdministrativeRegion = "10", Population = 25000 }, new Location { Name = "Carleton", Latitude = -43.0987, Longitude = 127.6782, Country = "CA", AdministrativeRegion = "10", Population = 25000 } }; foreach (var value in values) { trie.Insert(value); } //Act var results = trie.GetSuggestionsForPrefix("Car").ToList(); //Assert results.ShouldSatisfyAllConditions( () => results.Count.ShouldBe(2) ); }