Beispiel #1
0
                public void IsNumber_And_ValueIsNumber_PassTest(string value)
                {
                    _value = value;

                    var metric = new MetricDummy();

                    metric.SetValueType(DoDHelper.ValueTypeNumber);
                    _metric = metric;

                    Action action = ValidateMetric;

                    action.Should().NotThrow();
                }
Beispiel #2
0
                public void IsNumber_And_ValueIsNotNumber_ThrowD018(string value)
                {
                    _value = value;

                    var metric = new MetricDummy();

                    metric.SetValueType(DoDHelper.ValueTypeNumber);
                    _metric = metric;

                    Action action = ValidateMetric;

                    action.Should().Throw <DomainException>().And.Code.Should().Be(DomainError.D018.ToString());
                }
Beispiel #3
0
                public void IsSelect_And_ValueIsNotInSelectValues_ThrowD019(string value)
                {
                    _value = value;

                    var metric = new MetricDummy();

                    metric.SetValueType(DoDHelper.ValueTypeSelect);
                    metric.SetSelectValues("yes;no;maybe");
                    _metric = metric;

                    Action action = ValidateMetric;

                    action.Should().Throw <DomainException>().And.Code.Should().Be(DomainError.D019.ToString());
                }
Beispiel #4
0
                public void IsSelect_And_ValueIsInSelectValues_PassTest(string value)
                {
                    _value = value;

                    var metric = new MetricDummy();

                    metric.SetValueType(DoDHelper.ValueTypeSelect);
                    metric.SetSelectValues("yes;no;maybe");
                    _metric = metric;

                    Action action = ValidateMetric;

                    action.Should().NotThrow();
                }