public void Cleanup() { _repositoryMock = null; _repositoryMock = null; sut = null; viewData = null; }
public void StartUp() { viewData = new ViewDataDictionary(); _repositoryMock = new Mock<IGenericRepository>(); var city1 = new City {Name = "Asd", CityID = 1, Country = new Country {Name = "Asd"}}; var country1 = new Country {Name = "Asd", CountryID = 1, Cities = new[] {city1}}; var city2 = new City {Name = "Test", CityID = 2, Country = new Country {Name = "Test"}}; var country2 = new Country {Name = "Test", CountryID = 2, Cities = new[] {city2}}; tag1 = new Tag {TagID = 1, Name = "testTag1"}; tag2 = new Tag {TagID = 2, Name = "testTag2"}; tag3 = new Tag {TagID = 3, Name = "testTag3"}; var conferences = new[] { new Conference { Name = "asd", TargetCity = city2, TargetCountry = country2, Tags = new List<Tag> {tag1, tag2} }, new Conference { Name = "test", TargetCity = city1, TargetCountry = country1, Tags = new List<Tag> {tag3} } }; _repositoryMock.Setup(e => e.GetAll<Conference>()) .Returns(conferences); _repositoryMock.Setup(e => e.GetAll<Tag>()).Returns(new[] {tag1, tag2, tag3, new Tag {TagID = 4}}); sut = new FilterHelper {Conferences = _repositoryMock.Object.GetAll<Conference>()}; sut.Speakers = new List<Speaker> {new Speaker {User = new Attendee()}}; }