private static string GetFormattedApiModels() { var modelsAA = new List <Type> { typeof(Meta), typeof(TrackAnalysis), typeof(Bar), typeof(Beat), typeof(Tatum), typeof(Section), typeof(Segment), typeof(AudioAnalysis) }; var modelsP = new List <Type> { typeof(ExternalUrls), typeof(Image), typeof(Owner), typeof(Tracks), typeof(Playlist), typeof(PlaylistsRoot) }; var modelsTF = new List <Type> { typeof(TrackFeatures) }; var modelsTR = new List <Type> { typeof(AddedBy), typeof(Artist), typeof(Album), typeof(Track), typeof(TrackWrapper), typeof(TracksRoot), typeof(ReccomendationTracksRoot), typeof(Seed) }; var modelsAsList = ApiModelToOneWithAttributesHelper.ConvertMultipleTypes(modelsTR).ToList(); return(MergeStringsIntoOne(modelsAsList)); }
public void ConvertType_Works() { var result = ApiModelToOneWithAttributesHelper.ConvertType(typeof(TestType)); foreach (var property in typeof(TestType).GetProperties()) { Assert.That(result.Contains($"[JsonProperty(\"{property.Name}\")]")); Assert.That(result.Contains($"{this.GetProperPropertyName(property.Name)}")); } //NOTE: just paste it manualy instead of copying methods from implementation Assert.That(result.Contains("double")); Assert.That(result.Contains("List<double>")); Assert.That(result.Contains("List<int>")); Assert.That(result.Contains("List<string>")); Assert.That(result.Contains("double?")); Assert.That(result.Contains("DateTime")); Assert.That(result.Contains("DateTime?")); Assert.That(result.Contains("TestType2")); Assert.That(result.Contains("List<TestType2>")); }