コード例 #1
0
        public static IComparisonConstruction Build(Action <IComparisonBuilder> builder)
        {
            var comparisonBuilder = new ComparisonBuilder();

            builder(comparisonBuilder);

            return(comparisonBuilder.Construct());
        }
コード例 #2
0
        public Dummy()
        {
            var comparisonConstruction = ComparisonBuilder.Build(builder => builder
                                                                 .SetupDefaultComparison <int>(s =>
                                                                                               s.When((a, b) => a != b, Then.SetError("")))
                                                                 .SetupDefaultComparison <double>(s =>
                                                                                                  s.When(DoublesAreNotEqual, Then.SetError("")))
                                                                 .SetupComparisonOf <Instrument>(s =>
                                                                                                 s.IgnoreProperty(i => i.LastUpdated)
                                                                                                 .IgnoreProperty(i => i.ID)
                                                                                                 .SetupPropertyComparison(i => i.SerialNumber, (p) =>
                                                                                                                          p.When((a, b) => a == b, Then.MarkAsEqual)
                                                                                                                          .When((a, b) => a.StartsWith(b) || b.StartsWith(a), Then.SetWarning(""))
                                                                                                                          .Else(Then.SetError(""))))
                                                                 .SetupComparisonOf <Fluidset>(s =>
                                                                                               s.IgnoreProperty(f => f.LastUpdated)));


            var results = comparisonConstruction.Compare(new Instrument(), new Instrument());
        }