Tag() public method

Tag existing resources of given resource id / type combination
public Tag ( string tagName, string>.List resources ) : System.Threading.Tasks.Task
tagName string
resources string>.List
return System.Threading.Tasks.Task
示例#1
0
        public void CorrectRequestForTag() {
            var factory = Substitute.For<IConnection>();
            var client = new TagsClient(factory);

            List<KeyValuePair<string, string>> resources = new List<KeyValuePair<string, string>>(new KeyValuePair<string, string>[] {
                new KeyValuePair<string, string>("9001", "droplet"),
                new KeyValuePair<string, string>("9002", "droplet")
            });          

            client.Tag("notarealtag", resources);

            var parameters = Arg.Is<List<Parameter>>(list => (string)list[0].Value == "notarealtag");
            factory.Received().ExecuteRaw("tags/{name}/resources", parameters, Arg.Is<Models.Requests.TagResource>(data => data.Resources[1].Id == "9002"), Method.POST);
        }