public void GivenMoreComplexObject_WhenDumping_ThenShouldReturnCorrectString() { // Arrange object varToDump = new { Id = 42, PropertyString = "toto", PropertyDouble = 4.2, PropertyObject = new { SubProperty1 = "SubObject", SubProperty2 = 422 } }; var expectedDump = @"{ ""Id"": 42, ""PropertyString"": ""toto"", ""PropertyDouble"": 4.2, ""PropertyObject"": { ""SubProperty1"": ""SubObject"", ""SubProperty2"": 422 } }"; // Act var resultOfVarDump = VarDump.VarDumpJson(varToDump); // Assert Assert.That(resultOfVarDump, Is.EqualTo(expectedDump), $"Essaye encore de trouver le VarDump de {varToDump}"); }
public void VarDumpTests_FieldDumpTest() { string s = VarDump.Var_Dump(new A()); Console.WriteLine(s); Assert.IsTrue(true); }
protected async void Page_Load(object sender, EventArgs e) { // get a track var output = await SpotifyWebAPI.Track.GetTrack("0eGsygTp906u18L0Oimnem"); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
protected async void Page_Load(object sender, EventArgs e) { // get search for alter bridge albums var output = await SpotifyWebAPI.Album.Search("Blackbird", "Alter Bridge"); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
protected async void Page_Load(object sender, EventArgs e) { // get alter bridge's blackbird album var output = await SpotifyWebAPI.Album.GetAlbum("0Fk4lWAADmFMmuW6jp6xyE"); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
protected async void Page_Load(object sender, EventArgs e) { // get alter bridge var output = await SpotifyWebAPI.Artist.GetArtist("4DWX7u8BV0vZIQSpJQQDWU"); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected async void userGetCurrentUserProfile_Click(object sender, EventArgs e) { // get the user you just logged in with SpotifyWebAPI.User user = await SpotifyWebAPI.User.GetCurrentUserProfile(this.AuthenticationToken); output.Text = VarDump.Dump(user, 0); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected async void userGetUser_Click(object sender, EventArgs e) { // get my profile, returns a basic profile SpotifyWebAPI.User user = await SpotifyWebAPI.User.GetUser("tinyioda"); output.Text = VarDump.Dump(user, 0); }
public void GivenSimpleObject_WhenDumping_ThenShouldReturnCorrectString(object varToDump, object expectedResult) { // Arrange & Act var resultOfVarDump = VarDump.VarDumpJson(varToDump); // Assert Assert.That(resultOfVarDump, Is.EqualTo(expectedResult), $"Essaye encore de trouver le VarDump de {varToDump}, type: {varToDump.GetType().Name}, depth: 1"); }
protected async void Page_Load(object sender, EventArgs e) { List <string> artists = new List <string>(); artists.Add("4DWX7u8BV0vZIQSpJQQDWU"); // alter bridge var output = await SpotifyWebAPI.Artist.GetArtists(artists); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected async void userCreatePlaylist_Click(object sender, EventArgs e) { // get the user SpotifyWebAPI.User user = await SpotifyWebAPI.User.GetCurrentUserProfile(this.AuthenticationToken); // create the playlist, this method also returns the playlist var newPlaylist = await SpotifyWebAPI.Playlist.CreatePlaylist(user.Id, "test", true, this.AuthenticationToken); output.Text = VarDump.Dump(newPlaylist, 0); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected async void userGetPlaylists_Click(object sender, EventArgs e) { // get the user you just logged in with SpotifyWebAPI.User user = await SpotifyWebAPI.User.GetCurrentUserProfile(this.AuthenticationToken); // get this persons playlists SpotifyWebAPI.Page <Playlist> playlists = await user.GetPlaylists(this.AuthenticationToken); output.Text = VarDump.Dump(playlists, 0); }
protected async void Page_Load(object sender, EventArgs e) { var albums = new List <string>(); albums.Add("0Fk4lWAADmFMmuW6jp6xyE"); // blackbird albums.Add("14XXkmq6rjlKTxRkelMtZx"); // fortress albums.Add("0ocWLhnTiUKSq8Ksa3FX4Z"); // AB III var output = await SpotifyWebAPI.Album.GetAlbums(albums); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
protected async void Page_Load(object sender, EventArgs e) { List <string> tracks = new List <string>(); tracks.Add("0eGsygTp906u18L0Oimnem"); tracks.Add("1lDWb6b6ieDQ2xT7ewTC3G"); // get a track var output = await SpotifyWebAPI.Track.GetTracks(tracks); ((Literal)this.Master.FindControl("output")).Text = VarDump.Dump(output, 0); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected async void userGetPlaylist_Click(object sender, EventArgs e) { // get the user you just logged in with SpotifyWebAPI.User user = await SpotifyWebAPI.User.GetCurrentUserProfile(this.AuthenticationToken); // get all the playlists SpotifyWebAPI.Page <Playlist> playlists = await user.GetPlaylists(this.AuthenticationToken); // get the first playlist in the list // yes i know this is redundant but i am testing the method GetPlaylist() SpotifyWebAPI.Playlist playlist = await SpotifyWebAPI.Playlist.GetPlaylist(user, playlists.Items.FirstOrDefault().Id, this.AuthenticationToken); output.Text += VarDump.Dump(playlist, 0); // get the tracks // not by using GetPlaylist() in the previous command you already get the tracks, i'm just doing more testing here. SpotifyWebAPI.Page <PlaylistTrack> tracks = await playlist.GetPlaylistTracks(this.AuthenticationToken); output.Text += VarDump.Dump(tracks, 0); }
/// <summary> /// Extension do dump any object, only public properties, unforamtted. /// </summary> /// <typeparam name="T">any type</typeparam> /// <param name="objectToDump">object to dump</param> /// <returns></returns> public static string DumpUnFormatted <T>(this T objectToDump) { return(VarDump.VarDumpJsonUnFormatted(objectToDump)); }
/// <summary> /// Extension do dump any object, only public properties. /// </summary> /// <typeparam name="T">any type</typeparam> /// <param name="objectToDump">object to dump</param> /// <returns></returns> public static string Dump <T>(this T objectToDump) { return(VarDump.VarDumpJson(objectToDump)); }