public void SingleAddOnShouldParseCorrectly() { var strings = new[] { null, "Deployed add-ons:", null, ":", "Alias: fshare", "Instance Alias: myinstance", "Author: ", "Vendor: ", "Connection Data: \\\\zethos\\AddOns\\devteam\\myinstance", "Deploy Time: 2/24/2017 9:35:27 PM", }; var parser = new DeployedAddOnParser(); List <DeployedAddOnInfo> results = null; var ex = Record.Exception(() => results = parser.ParseResults(strings).ToList()); ex.Should().BeNull(); results.Should().NotBeNull().And.HaveCount(1); var addon = results[0]; addon.Alias.Should().Be("fshare"); addon.InstanceAlias.Should().Be("myinstance"); addon.Author.Should().Be(""); addon.Vendor.Should().Be(""); addon.ConnectionData.Should().Be("\\\\zethos\\AddOns\\devteam\\myinstance"); addon.DeploymentTime.Should().Be("2/24/2017 9:35:27 PM"); }
public void NoAddOnsShouldParseCorrectly() { var strings = new[] { null, "No deployed add-ons found", null }; var parser = new DeployedAddOnParser(); IEnumerable <DeployedAddOnInfo> results = null; var ex = Record.Exception(() => results = parser.ParseResults(strings)); ex.Should().BeNull(); results.Should().NotBeNull().And.BeEmpty(); }