public void Update_ByIndexer()
        {
            //Arrange
            var config   = new MockConfigManager();
            var target   = new DiagnosticsAreaCollection(config);
            var expected = new DiagnosticsArea(MockConfigManager.Area1Name);
            var category = new DiagnosticsCategory(Guid.NewGuid().ToString());

            expected.DiagnosticsCategories.Add(category);
            var originalArea = target[MockConfigManager.Area1Name];
            int index        = target.IndexOf(originalArea);

            //Act
            target[index] = expected;

            //Assert
            Assert.IsTrue(target[index] == expected);
            Assert.IsTrue(target[index] != originalArea);
            Assert.IsTrue(target[index].DiagnosticsCategories.Count == 1);
            Assert.AreEqual(target[index].DiagnosticsCategories[0], category);
        }
        public void Update_ByIndexerWithNullValue_ThrowsArgumentNullException()
        {
            //Arrange
            var  config                  = new MockConfigManager();
            var  target                  = new DiagnosticsAreaCollection(config);
            var  originalArea            = target[MockConfigManager.Area1Name];
            int  index                   = target.IndexOf(originalArea);
            bool expectedExceptionThrown = false;

            //Act
            try
            {
                target[index] = null;
            }
            catch (ArgumentNullException)
            {
                expectedExceptionThrown = true;
            }

            //Assert
            Assert.IsTrue(expectedExceptionThrown);
        }