public void AddError()
        {
            string testMessage = "Test Error Message";

            var target           = new TestDataExtensionDependencyTarget();
            var targetDependency = new DataExtensionDependencyState(target);

            targetDependency.AddError(testMessage);

            Assert.AreEqual(targetDependency.Errors.Count, 1);
            Assert.IsTrue(targetDependency.Errors.First() == testMessage);
        }
        public void UpdateAvailability()
        {
            var target           = new TestDataExtensionDependencyTarget();
            var targetDependency = new DataExtensionDependencyState(target);

            // Unavailable -> Available
            targetDependency.UpdateAvailability(DataExtensionAvailability.Available);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.Available);

            // Available -> Error
            targetDependency.UpdateAvailability(DataExtensionAvailability.Error);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.Error);

            // Error X->X Available
            targetDependency.UpdateAvailability(DataExtensionAvailability.Available);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.Error);

            // Error -> Undetermined
            targetDependency.AddError("Should go away");
            targetDependency.UpdateAvailability(DataExtensionAvailability.Undetermined);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.Undetermined);
            Assert.AreEqual(targetDependency.Errors.Count, 0);

            // Undetermined -> MissingIndirectRequirement
            targetDependency.UpdateAvailability(DataExtensionAvailability.MissingIndirectRequirement);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.MissingIndirectRequirement);

            // MissingIndirectRequirement -> MissingRequirement
            targetDependency.UpdateAvailability(DataExtensionAvailability.MissingRequirement);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.MissingRequirement);

            // MissingRequirement X->X MissingIndirectRequirement
            targetDependency.UpdateAvailability(DataExtensionAvailability.MissingIndirectRequirement);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.MissingRequirement);

            // MissingRequirement X->X IndirectError
            targetDependency.UpdateAvailability(DataExtensionAvailability.IndirectError);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.IndirectError);

            // IndirectError -> Error
            targetDependency.UpdateAvailability(DataExtensionAvailability.Error);
            Assert.AreEqual(targetDependency.Availability, DataExtensionAvailability.Error);
        }