public void CorrectRequestForUntag() { var factory = Substitute.For <IConnection>(); var client = new TagsClient(factory); var resources = new Models.Requests.TagResources() { Resources = new List <Models.Requests.TagResource>() { new Models.Requests.TagResource() { Id = "9001", Type = "droplet" }, new Models.Requests.TagResource() { Id = "9002", Type = "droplet" } } }; client.Untag("notarealtag", resources); var parameters = Arg.Is <List <Parameter> >(list => (string)list[0].Value == "notarealtag"); var body = Arg.Is <Models.Requests.TagResources>(tr => tr.Resources.SequenceEqual(resources.Resources)); factory.Received().ExecuteRaw("tags/{name}/resources", parameters, body, Method.DELETE); }
/// <summary> /// Untag existing resources of given resource id / type combination /// </summary> public Task Untag(string tagName, Models.Requests.TagResources resources) { var parameters = new List <Parameter> { new Parameter("name", tagName, ParameterType.UrlSegment) }; return(_connection.ExecuteRaw("tags/{name}/resources", parameters, resources, Method.DELETE)); }
/// <summary> /// Tag existing resources of given resource id / type combination /// </summary> public Task Tag(string tagName, Models.Requests.TagResources resources) { var parameters = new List <Parameter> { new Parameter { Name = "name", Value = tagName, Type = ParameterType.UrlSegment } }; return(_connection.ExecuteRaw("tags/{name}/resources", parameters, resources, Method.POST)); }