public void GetAllNames_Successful() { // Arrange var mockHelper = new Mock<IRenUkHtmlHelper>(); var dataSource = new RenUkDataSource(mockHelper.Object); dataSource.SetData(_aggregateData); // call public method, not on I/F, to set the data for testing // Act var result = dataSource.GetAllNames().ToArray(); // Assert Assert.AreEqual(3, result.Count(), "Expected the names of 3 import aggregates to be returned."); Assert.AreEqual(AchairnFarm, result[0], string.Format("Expected first aggregate name to be {0}", AchairnFarm)); Assert.AreEqual(AchanyEstate, result[1], string.Format("Expected first aggregate name to be {0}", AchanyEstate)); Assert.AreEqual(Achlachan, result[2], string.Format("Expected first aggregate name to be {0}", Achlachan)); }
public void GetAllNames_None_Unsuccessful() { // Arrange var mockHelper = new Mock<IRenUkHtmlHelper>(); var dataSource = new RenUkDataSource(mockHelper.Object); dataSource.SetData(new List<ImportAggregate>()); // call public method, not on I/F, to set the data for testing // Act var result = dataSource.GetAllNames().ToArray(); // Assert Assert.AreEqual(0, result.Count(), "Expected Zero import aggregates to be returned."); }