public void ConvertBackTest()
        {
            TaskStateConverter target = new TaskStateConverter();
            string value = "Unassigned";
            Type targetType = typeof(TaskState);
            object paramter = null;
            CultureInfo culture = null;
            TaskState expected = TaskState.Unassigned;
            TaskState actual = (TaskState)target.ConvertBack(value, targetType, paramter, culture);
            Assert.AreEqual(expected, actual);

            value = "In Progress";
            expected = TaskState.In_Progress;
            actual = (TaskState)target.ConvertBack(value, targetType, paramter, culture);
            Assert.AreEqual(expected, actual);

            value = "Completed";
            expected = TaskState.Completed;
            actual = (TaskState)target.ConvertBack(value, targetType, paramter, culture);
            Assert.AreEqual(expected, actual);

            value = "Blocked";
            expected = TaskState.Blocked;
            actual = (TaskState)target.ConvertBack(value, targetType, paramter, culture);
            Assert.AreEqual(expected, actual);

            value = "Invalid";
            expected = TaskState.Unassigned;
            actual = (TaskState)target.ConvertBack(value, targetType, paramter, culture);
            Assert.AreEqual(expected, actual);

            expected = TaskState.Unassigned;
            actual = (TaskState)target.ConvertBack(null, targetType, paramter, culture);
            Assert.AreEqual(expected, actual);
        }
        public void ConvertTest()
        {
            TaskStateConverter target = new TaskStateConverter();
            TaskState value = TaskState.Unassigned;
            Type targetType = typeof(string);
            object paramter = null;
            CultureInfo culture = null;
            string expected = "Unassigned";
            string actual = target.Convert(value, targetType, paramter, culture) as string;
            Assert.AreEqual(expected, actual);

            value = TaskState.In_Progress;
            expected = "In Progress";
            actual = target.Convert(value, targetType, paramter, culture) as string;
            Assert.AreEqual(expected, actual);

            value = TaskState.Completed;
            expected = "Completed";
            actual = target.Convert(value, targetType, paramter, culture) as string;
            Assert.AreEqual(expected, actual);

            value = TaskState.Blocked;
            expected = "Blocked";
            actual = target.Convert(value, targetType, paramter, culture) as string;
            Assert.AreEqual(expected, actual);

            value = (TaskState)5;
            expected = "None";
            actual = target.Convert(value, targetType, paramter, culture) as string;
            Assert.AreEqual(expected, actual);

            expected = string.Empty;
            actual = target.Convert(null, targetType, paramter, culture) as string;
            Assert.AreEqual(expected, actual);
        }