public void ShouldThrowFileNotFoundException(string userInput) { string outputFormat = "importing: Name: \"{0}\"; Categories: {1}; Twitter: {2}"; ProductsFeedImporter.ProductsFeedImporter productImporter = new ProductsFeedImporter.ProductsFeedImporter(outputFormat); var ex = Assert.Throws <FileNotFoundException>(() => productImporter.ImportProductDetails(userInput)); }
public void ShouldThrowInvalidOpException(string userInput) { string outputFormat = "importing: Name: \"{0}\"; Categories: {1}; Twitter: {2}"; ProductsFeedImporter.ProductsFeedImporter productImporter = new ProductsFeedImporter.ProductsFeedImporter(outputFormat); var ex = Assert.Throws <InvalidOperationException>(() => productImporter.ImportProductDetails(userInput)); Assert.Equal("Invalid input! Valid Syntax: <import> <capterra/softwareadvice/..> <file full path>", ex.Message); }
public void ShouldThrowException_ProviderNotSupported(string userInput) { string outputFormat = "importing: Name: \"{0}\"; Categories: {1}; Twitter: {2}"; ProductsFeedImporter.ProductsFeedImporter productImporter = new ProductsFeedImporter.ProductsFeedImporter(outputFormat); var ex = Assert.Throws <InvalidOperationException>(() => productImporter.ImportProductDetails(userInput)); Assert.Equal("Provider not supported!", ex.Message); }
public void ShouldImportProductDetails(string userInput) { string outputFormat = "importing: Name: \"{0}\"; Categories: {1}; Twitter: {2}"; ProductsFeedImporter.ProductsFeedImporter productImporter = new ProductsFeedImporter.ProductsFeedImporter(outputFormat); var feeds = productImporter.ImportProductDetails(userInput); int resultLen = feeds != null ? feeds.Count : 0; Assert.NotNull(feeds); Assert.True(resultLen > 0); }