public void TestBuild()
{
TestCalculateDigest();
TestDetectCandidates();
TestGenerateCommands();
_builder.RetrievalMethod = new Archive();
_builder.Uri = new FeedUri("http://0install.de/feeds/test/test1.xml");
_builder.Icons.Add(new Icon {MimeType = Icon.MimeTypePng, Href = new Uri("http://0install.de/test.png")});
_builder.Icons.Add(new Icon {MimeType = Icon.MimeTypeIco, Href = new Uri("http://0install.de/test.ico")});
_builder.SecretKey = new OpenPgpSecretKey(keyID: 123, fingerprint: new byte[] {1, 2, 3}, userID: "user");
var signedFeed = _builder.Build();
signedFeed.Feed.Name.Should().Be(_builder.MainCandidate.Name);
signedFeed.Feed.Uri.Should().Be(_builder.Uri);
signedFeed.Feed.Summaries.Should().Equal(new LocalizableStringCollection {_builder.MainCandidate.Summary});
signedFeed.Feed.NeedsTerminal.Should().Be(_builder.MainCandidate.NeedsTerminal);
signedFeed.Feed.Elements.Should().Equal(
new Implementation
{
ID = "sha1new=" + ManifestDigest.Empty.Sha1New,
ManifestDigest = ManifestDigest.Empty,
Version = _builder.MainCandidate.Version,
Architecture = _builder.MainCandidate.Architecture,
Commands = {new Command {Name = Command.NameRun, Path = "test"}},
RetrievalMethods = {_builder.RetrievalMethod}
});
signedFeed.Feed.Icons.Should().Equal(_builder.Icons);
signedFeed.SecretKey.Should().Be(_builder.SecretKey);
}