public override void Add() { for (int i = 0; i < 10; i++) { var model = new SongAddModel() { Genre = this.Generator.GetRandomString(5, 25), Title = this.Generator.GetRandomString(10, 75), Year = this.Generator.GetRandomNumber(2000, 2015) }; var json = JsonConvert.SerializeObject(model); this.Consumer.Post(this.Uri, json); } }
public override void Update(int id) { var song = new SongAddModel() { Genre = "Update " + this.Generator.GetRandomString(5, 15), Title = "Update " + this.Generator.GetRandomString(5, 15), Year = this.Generator.GetRandomNumber(1980, 2000) }; var songAsJson = JsonConvert.SerializeObject(song); var request = this.Consumer.Put(Uri + "/" + id, songAsJson); Console.WriteLine(request); }