Ejemplo n.º 1
0
        public async Task DeleteLabel()
        {
            var createdLabel =
                await _labelsApi.CreateLabel(GenerateName("Cool Resource"), new Dictionary <string, string>(),
                                             _organization.Id);

            Assert.IsNotNull(createdLabel);

            var foundLabel = await _labelsApi.FindLabelById(createdLabel.Id);

            Assert.IsNotNull(foundLabel);

            // delete user
            await _labelsApi.DeleteLabel(createdLabel);

            var exception = Assert.ThrowsAsync <AggregateException>(async() => await _labelsApi.FindLabelById(createdLabel.Id));

            Assert.IsNotNull(exception);
            Assert.AreEqual("label not found", exception.InnerException.Message);
            Assert.AreEqual(typeof(HttpException), exception.InnerException.GetType());
        }