Example #1
0
        public void measure_dimension_should_modify_coeffiecient_units_properly()
        {
            var basicUnit = new BasicMeasureUnitTestBuilder().BuildArg();

            var coefficientUnitBuilder = new CoefficientMeasureUnitTestBuilder();
            var coefficientUnit        = coefficientUnitBuilder.BuildArg();

            var dimension = new MeasureDimensionTestBuilder()
                            .WithBasicMeasureUnitArg(basicUnit)
                            .WithCoefficientMeasureUnitArg(coefficientUnit)
                            .Build();

            var arg = coefficientUnitBuilder
                      .WithTitle("new title")
                      .WithTitleSlug("new slug")
                      .WithRatioFromBasicMeasureUnit(0.0226)
                      .BuildArg();

            dimension.ModifyCoefficientUnit(arg);

            Check.That(dimension.MeasureUnits.First(c => c.Id == arg.Id))
            .Considering().All.Properties.IsEqualTo(arg);
        }