protected override void Context()
        {
            var dim            = A.Fake <IDimension>();
            var meanParam      = new Parameter().WithName("Mean_xy").WithDimension(dim).WithValue(2.2);
            var deviationParam = new Parameter().WithName("Std_xy").WithDimension(dim).WithValue(3.5);

            _distributedParam = new DistributedParameter().WithName("P1").WithDimension(dim);
            _distributedParam.Add(meanParam);
            _distributedParam.Add(deviationParam);
            var noDimension      = A.Fake <IDimension>();
            var dimensionFactory = A.Fake <IDimensionFactory>();

            A.CallTo(() => dimensionFactory.NoDimension).Returns(noDimension);

            sut = new DistributionFormulaFactory(new ObjectPathFactory(new AliasCreator()), new ObjectBaseFactory(A.Fake <Utility.Container.IContainer>(), dimensionFactory, new IdGenerator(), A.Fake <ICreationMetaDataFactory>())).CreateNormalDistributionFormulaFor(_distributedParam, meanParam, deviationParam);
        }
Пример #2
0
        protected override void Context()
        {
            sut = new DistributedParameter();
            var pathFactory = new ObjectPathFactory(new AliasCreator());

            _meanParameter = new Parameter {
                Name = Constants.Distribution.MEAN
            }.WithFormula(new ExplicitFormula("0"));
            _stdParameter = new Parameter {
                Name = Constants.Distribution.DEVIATION
            }.WithFormula(new ExplicitFormula("1"));
            _percentileParameter = new Parameter {
                Name = Constants.Distribution.PERCENTILE
            }.WithFormula(new ExplicitFormula("0.5"));
            sut.Add(_meanParameter);
            sut.Add(_stdParameter);
            sut.Add(_percentileParameter);
            sut.Formula = new NormalDistributionFormula();
            sut.Formula.AddObjectPath(pathFactory.CreateRelativeFormulaUsablePath(sut, _meanParameter));
            sut.Formula.AddObjectPath(pathFactory.CreateRelativeFormulaUsablePath(sut, _stdParameter));
            sut.Formula.ResolveObjectPathsFor(sut);
        }