public void Serialize_Json() { string name = "TestName"; string description = "Test Description"; SemanticVersion latest = new SemanticVersion(1, 2, 3); List <PublicationSummaryModel> publications = new List <PublicationSummaryModel>() { }; var uut = new PackageResultModel() { Name = name, Description = description, Latest = latest, Publications = publications, }; var json = TestUtils.JsonSerialize(uut); var expected = "{\"name\":\"TestName\"," + "\"description\":\"Test Description\"," + "\"latest\":\"1.2.3\"," + "\"publications\":[]}"; Assert.Equal(expected, json); }
public void DefaultValues() { var uut = new PackageResultModel(); Assert.Null(uut.Name); Assert.Null(uut.Description); Assert.Null(uut.Latest); Assert.Null(uut.Publications); }
public void InitializeValues() { string name = "TestName"; string description = "TestDescription"; SemanticVersion latest = new SemanticVersion(1, 0, 0); List <PublicationSummaryModel> publications = new List <PublicationSummaryModel>() { }; var uut = new PackageResultModel() { Name = name, Description = description, Latest = latest, Publications = publications, }; Assert.Equal(name, uut.Name); Assert.Equal(description, uut.Description); Assert.Equal(latest, uut.Latest); Assert.Equal(publications, uut.Publications); }