public void GetDataTypes_Successful() { // Arrange: var dataService = new DataService(_repository, _dataSourceRepository, _dataTypeRepository, _importServiceResolver, _dataSourceResolver); // Act var result = dataService.GetDataTypes().ToArray(); // Assert var minCount = result.Count() >= 2; Assert.IsTrue(minCount, "Expected at least 2 data types to be returned, 'Status' and 'Turbine'"); var containsStatus = result.Contains("Status"); var containsTurbine = result.Contains("Turbine"); Assert.IsTrue(containsStatus, "Expected 'Status' to be in the returned datatypes."); Assert.IsTrue(containsTurbine, "Expected 'turbine' to be in the returned datatypes."); }
public void GetDataTypes_Successful_ReturnsCollection() { // Arrange var mockImportService = new Mock<IRenUkImportService>(); mockImportService.Setup(i => i.ImportData(It.IsAny<int>(), It.IsAny<string>())).Returns(false); _mockDataTypeRepository.Setup(t => t.GetAll()).Returns(_dataTypes); var dataService = new DataService(_mockAggregateRepository.Object, _mockDatasourceRepository.Object, _mockDataTypeRepository.Object, _mockImportServiceResolver.Object, _mockDataSourceResolver.Object); // Act var results = dataService.GetDataTypes().ToArray(); // Assert Assert.AreEqual(2, results.Count(), "Expected 2 datatypes to be returned."); Assert.AreEqual("Footprint", results[0], "Expected first DataType to be 'Footprint'."); Assert.AreEqual("Status", results[1], "Expected second DataType to be 'Status'."); }