Ejemplo n.º 1
0
        public void DoNormalize(Specification specification)
        {
            _specification = specification;

            while (GetNext() != null)
            {
                var current = GetCurrent();

                if (current.GetLineType() == LineType.Executable | current.GetLineType() == LineType.BreakLine)
                {
                    if (PrevewNext() != null)
                    {
                        if (PrevewNext().GetLineType() == LineType.BreakLine)
                        {
                            current.PrepareJoinNext();
                        }
                        else if (current.GetLineType() == LineType.BreakLine)
                        {
                            current.JoinLine();
                        }
                    }
                    else if (current.GetLineType() == LineType.BreakLine)
                    {
                        current.JoinLine();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static Specification Builder(string specification)
        {
            if (specification == null)
                throw new NullSpecificationException();

            var instance = new Specification
                               {
                                   LineSpecCollection =
                                       specification.MultiLineAsList().ToList().Select(line => new LineSpec(line)).
                                       ToList()
                               };

            new SpecificationNormalizeManager().Normalize(instance);

            return instance;
        }
 public void Normalize(Specification specification)
 {
     AssemblyLoader<ISpecificationNormalize>.GetAll().ToList().ForEach(s => s.DoNormalize(specification));
 }