private void BuildConditions(string name, int year, Season season, int day, DayOfWeek weekday, string spouse, int hearts, bool cc, bool key) { var exNpc = new ExtendNPC() { SetDialogue = MockData.CharacterDialogue(name) as Dictionary <string, string> }; var npc = _factory.CreateInstance <INPCWrapper>(exNpc); npc.Name = name; ((MockNPCWrapper)npc).MockDialogue = MockData.CharacterDialogue(name); dynamic game = _factory.CreateInstance <IGameWrapper>(); game.year = year; game.currentSeason = season == Season.Unknown ? string.Empty : season.ToString().ToLower(); game.dayOfMonth = day; game.shortDayNameFromDayOfSeason = new Func <int, string>(i => weekday.ToString()); game.player.spouse = spouse; game.player.friendshipData = new Dictionary <string, IFriendshipWrapper>(); if (hearts > 0) { var friendship = _factory.CreateInstance <IFriendshipWrapper>(); friendship.Points = hearts; ((Dictionary <string, IFriendshipWrapper>)game.player.friendshipData).Add(name, friendship); } game.isLocationAccessible = new Func <string, bool>(s => cc); game.player.HasTownKey = key; Game1.content = new MockLocalizedContentManager(new MockServiceProvider(), Path.Combine("..", "..", "..")); Game1.random = new Random(); ((MockWrapperFactory)_factory).SetInstance <IGameWrapper>(objects => game); //Console.WriteLine($"{name} {year} {season} {day} {weekday} {spouse} {hearts} {cc} {key}"); if (name == "Jodi" && year == 1 && season == Season.Unknown && day == 2 && weekday == DayOfWeek.Tue && spouse == "" && hearts == 250) { var x = 45; } var vanillaTest = new TestNPC { Game = game, NPC = npc }; var vanillaResult = vanillaTest.tryToRetrieveDialogue(season == Season.Unknown ? string.Empty : season.ToString().ToLower() + "_", hearts / 250); var patchTest = new DialogueLogic(new ConditionRepository(), _logger, _factory); var patchResult = patchTest.GetDialogue(ref npc, season != Season.Unknown); if (vanillaResult == null) { if (patchResult != null) { Console.WriteLine(string.Join(",", patchResult.CurrentEmotion)); Console.WriteLine($"{name} {year} {season} {day} {weekday} {spouse} {hearts} {cc} {key}"); } Assert.AreEqual(null, patchResult); //Console.WriteLine("Is Null"); } else { if (vanillaResult?.CurrentEmotion != patchResult?.CurrentEmotion) { Console.WriteLine(vanillaResult.CurrentEmotion); Console.WriteLine(patchResult?.CurrentEmotion); Console.WriteLine($"{name} {year} {season} {day} {weekday} {spouse} {hearts} {cc} {key}"); } Assert.That(vanillaResult?.CurrentEmotion == patchResult?.CurrentEmotion); } }