private static void AssertSanitization(int main, int extras, int completionist, int mainExpected, int extrasExpected, int completionistExpected)
        {
            var game = new AppEntity(1, "test", AppEntity.GameTypeName);

            game.SetMainTtb(main, main == 0);
            game.SetExtrasTtb(extras, extras == 0);
            game.SetCompletionistTtb(completionist, completionist == 0);

            Imputer.Sanitize(new [] { game });

            var ttbs = String.Format(CultureInfo.InvariantCulture, "{0}/{1}/{2}", main, extras, completionist);

            Assert.AreEqual(mainExpected, game.MainTtb, "Invalid Main sanitization for TTBs: " + ttbs);
            Assert.AreEqual(extrasExpected, game.ExtrasTtb, "Invalid Extras sanitization for TTBs: " + ttbs);
            Assert.AreEqual(completionistExpected, game.CompletionistTtb, "Invalid Completionist sanitization for TTBs: " + ttbs);
        }
Example #2
0
        private static void PopulateAppEntity(AppEntity app, HltbInfo hltbInfo)
        {
            app.HltbName = hltbInfo.Name;

            var mainTtb = GetTtb(app, "main", app.MainTtb, app.MainTtbImputed, hltbInfo.MainTtb);

            app.SetMainTtb(mainTtb, mainTtb == 0);

            var extrasTtb = GetTtb(app, "extras", app.ExtrasTtb, app.ExtrasTtbImputed, hltbInfo.ExtrasTtb);

            app.SetExtrasTtb(extrasTtb, extrasTtb == 0);

            var completionistTtb = GetTtb(app, "completionist", app.CompletionistTtb, app.CompletionistTtbImputed, hltbInfo.CompletionistTtb);

            app.SetCompletionistTtb(completionistTtb, completionistTtb == 0);

            if (hltbInfo.ReleaseDate != AppEntity.UnknownDate)
            {
                app.ReleaseDate = hltbInfo.ReleaseDate;
            }
        }