Esempio n. 1
0
        public void Test_AddTargetToEmptyDict()
        {
            IArticleConfigProfile configProfile = InitConfigModel();

            ArticleSourceStore testBucket = new ArticleSourceStore(configProfile);

            ISourceValues values = new ArticleEmptySource();

            IArticleTarget testArticle      = testBucket.AddGeneralItem(HEAD_CODE_NULL, PART_CODE_NULL, BODY_CODE_TEST, BODY_SEED_NULL, values);
            string         testArticleLabel = "0-0-FACT_UNKNOWN-1";

            Assert.AreEqual(testArticleLabel, testArticle.ToSymbolString <ArticleCodeCz>());
        }
Esempio n. 2
0
 public int CompareTo(IArticleTarget other)
 {
     if (IsEqualToSame(other))
     {
         return(0);
     }
     else if (IsGreaterToSame(other))
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }
Esempio n. 3
0
 private bool IsSmallerToSame(IArticleTarget other)
 {
     if (this.InternalHead != other.Head())
     {
         return(this.InternalHead < other.Head());
     }
     if (this.InternalPart != other.Part())
     {
         return(this.InternalPart < other.Part());
     }
     if (this.InternalCode != other.Code())
     {
         return(this.InternalCode < other.Code());
     }
     return(this.InternalSeed < other.Seed());
 }
Esempio n. 4
0
 private bool IsGreaterToSame(IArticleTarget other)
 {
     if (this.InternalHead != other.Head())
     {
         return(this.InternalHead > other.Head());
     }
     if (this.InternalPart != other.Part())
     {
         return(this.InternalPart > other.Part());
     }
     if (this.InternalCode != other.Code())
     {
         return(this.InternalCode > other.Code());
     }
     return(this.InternalSeed > other.Seed());
 }
Esempio n. 5
0
        public void Test_AddSecondTargetToDictBetween()
        {
            IArticleConfigProfile configProfile = InitConfigModel();

            ArticleSourceStore testBucket = new ArticleSourceStore(configProfile);

            const TargetSeed TestSeed01 = 1;
            const TargetSeed TestSeed02 = 3;
            const TargetSeed TestSeed03 = 4;

            ISourceValues values = new ArticleEmptySource();

            IArticleTarget prepArticle1 = testBucket.StoreGeneralItem(HEAD_CODE_NULL, PART_CODE_NULL, BODY_CODE_TEST, TestSeed01, values);
            IArticleTarget backArticle2 = testBucket.StoreGeneralItem(HEAD_CODE_NULL, PART_CODE_NULL, BODY_CODE_TEST, TestSeed02, values);
            IArticleTarget backArticle3 = testBucket.StoreGeneralItem(HEAD_CODE_NULL, PART_CODE_NULL, BODY_CODE_TEST, TestSeed03, values);

            IArticleTarget testArticle      = testBucket.AddGeneralItem(HEAD_CODE_NULL, PART_CODE_NULL, BODY_CODE_TEST, BODY_SEED_NULL, values);
            string         testArticleLabel = "0-0-FACT_UNKNOWN-2";

            Assert.AreEqual(testArticleLabel, testArticle.ToSymbolString <ArticleCodeCz>());
        }
Esempio n. 6
0
 public static bool EqualitySelector(IArticleTarget target, TargetHead codeHead, TargetPart codePart, ConfigCode codeBody)
 {
     return(target.Head() == codeHead && target.Part() == codePart && target.Code() == codeBody);
 }
Esempio n. 7
0
 public bool Equals(IArticleTarget other)
 {
     return(this.IsEqualToSame(other));
 }
Esempio n. 8
0
 public bool IsEqualByCodePlusHeadAndPart(IArticleTarget other)
 {
     return(IsEqualByCodePlusHeadAndPart(other.Code(), other.Head(), other.Part()));
 }
Esempio n. 9
0
 public bool IsEqualByCodePlusHeadAndPart(ConfigCode otherCode, IArticleTarget other)
 {
     return(IsEqualByCodePlusHeadAndPart(otherCode, other.Head(), other.Part()));
 }
Esempio n. 10
0
 public bool IsEqualByHeadAndPart(IArticleTarget other)
 {
     return(this.InternalHead == other.Head() && this.InternalPart == other.Part());
 }
Esempio n. 11
0
 public bool IsEqualByHead(IArticleTarget other)
 {
     return(this.InternalHead == other.Head());
 }
Esempio n. 12
0
 private bool IsEqualToSame(IArticleTarget other)
 {
     return(this.InternalHead == other.Head() && this.InternalPart == other.Part() && this.InternalCode == other.Code() && this.InternalSeed == other.Seed());
 }