public void UpdateFile2Test() { const string data = "hello"; using (var server = new HttpServer(new RequestHandler { EstimatedMethod = "PUT", EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/portins/1/loas/test", Helper.AccountId), EstimatedContent = data, EstimatedHeaders = new Dictionary <string, string> { { "Content-Type", "media/type" } } })) { var client = Helper.CreateClient(); var portIn = new PortIn { Id = "1" }; portIn.SetClient(client); portIn.UpdateFile("test", Encoding.UTF8.GetBytes(data), "media/type").Wait(); if (server.Error != null) { throw server.Error; } } }