public override void Add() { for (int i = 0; i < 10; i++) { var model = new ArtistAddModel() { Name = this.Generator.GetRandomString(5, 25), Country = this.Generator.GetRandomString(10, 50), BirthDate = this.Generator.GetRandomDate(before: DateTime.Now, after: new DateTime(1990, 2, 2)) }; var json = JsonConvert.SerializeObject(model); this.Consumer.Post(this.Uri, json); } }
public override void Update(int id) { var song = new ArtistAddModel() { Name = "Update " + this.Generator.GetRandomString(5, 15), Country = "Update " + this.Generator.GetRandomString(5, 15), BirthDate = this.Generator.GetRandomDate(before: DateTime.Now, after: new DateTime(1990, 2, 2)) }; var songAsJson = JsonConvert.SerializeObject(song); var request = this.Consumer.Put(this.Uri + "/" + id, songAsJson); Console.WriteLine(request); }