DigitalOcean.API.Clients.TagsClient.Get C# (CSharp) 메소드

Get() 공개 메소드

Retrieve an individual Tag by name
public Get ( string tagName ) : Task
tagName string
리턴 Task
        public Task<Tag> Get(string tagName) {
            var parameters = new List<Parameter> {
                new Parameter { Name = "name", Value = tagName, Type = ParameterType.UrlSegment }
            };
            return _connection.ExecuteRequest<Tag>("tags/{name}", parameters, null, "tag");
        }

Usage Example

예제 #1
0
        public void CorrectRequestForGet() {
            var factory = Substitute.For<IConnection>();
            var client = new TagsClient(factory);

            client.Get("notarealtag");

            var parameters = Arg.Is<List<Parameter>>(list => (string)list[0].Value == "notarealtag");
            factory.Received().ExecuteRequest<Tag>("tags/{name}", parameters, null, "tag");
        }