public void ItDeterminesRepositoryKind(string repoUrl, string repoType, RepositoryKind expectedKind) { var package = new Package { Version = "1.0.0", RepositoryUrl = repoUrl, RepositoryType = repoType, }; var model = new DisplayPackageViewModel(package, null, "test"); Assert.Equal(expectedKind, model.RepositoryType); }
public void ItDeterminesRepositoryKind(string repoUrl, string repoType, RepositoryKind expectedKind, string expectedUrl) { var package = new Package { Version = "1.0.0", RepositoryUrl = repoUrl, RepositoryType = repoType, PackageRegistration = new PackageRegistration { Owners = Enumerable.Empty <User>().ToList(), Packages = Enumerable.Empty <Package>().ToList() } }; var model = CreateDisplayPackageViewModel(package, currentUser: null, packageKeyToDeprecation: null, readmeHtml: null); Assert.Equal(expectedKind, model.RepositoryType); Assert.Equal(expectedUrl, model.RepositoryUrl); }