public AvailablePluginViewModel(PublishedPluginDescription plugin, Action download) { Name = plugin.Name; Description = plugin.Description; Author = plugin.Author; Version = plugin.Identifier.Version; Website = new Uri(plugin.Website); DownloadCommand = new DelegateCommand2(download); }
public void TestConstructionInvalidWebsite() { var plugin = new PublishedPluginDescription { Name = "Foo", Identifier = new PluginIdentifier("TestPlugin", Version.Parse("1.4.3")), Website = "Fwaadasw" }; var viewModel = new AvailablePluginViewModel(plugin, () => {}); viewModel.Website.Should().BeNull(); }
public AvailablePluginViewModel(PublishedPluginDescription plugin, Action download) { Name = plugin.Name; Description = plugin.Description; Author = plugin.Author; Version = plugin.Identifier.Version; Uri.TryCreate(plugin.Website, UriKind.Absolute, out var uri); Website = uri; DownloadCommand = new DelegateCommand2(download); }
public void TestRoundtrip() { var description = new PublishedPluginDescription { Author = "Simon", Publisher = "Dreamcatcher", Description = "And there was no one left", SizeInBytes = 2131412, }; var actualDescription = BinarySerializerTest.Roundtrip(description); actualDescription.Author.Should().Be("Simon"); actualDescription.Publisher.Should().Be("Dreamcatcher"); actualDescription.Description.Should().Be("And there was no one left"); actualDescription.SizeInBytes.Should().Be(2131412); }