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

            Assert.IsNotNull(createdLabel);

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

            Assert.IsNotNull(foundLabel);

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

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

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