add C++, Typescript and more stuff
This commit is contained in:
@@ -126,6 +126,31 @@ public class RewardSettlementTests
|
||||
|
||||
private void Settle() => typeof(CombatSceneController).GetMethod("SettleRunRewardsIfNeeded", Private).Invoke(_controller, null);
|
||||
|
||||
[Test]
|
||||
public void CampaignUnlockCommitsBeforeEndlessAndFailedSaveNeverAnnouncesSuccess()
|
||||
{
|
||||
_save.Save(SaveData.CreateDefault());
|
||||
Set(_run, "_wavesCleared", 10);
|
||||
Set(_run, "currentWaveNumber", 11);
|
||||
Directory.CreateDirectory(_save.BackupPath);
|
||||
var persist = typeof(CombatSceneController).GetMethod("PersistCampaignUnlocks", Private);
|
||||
persist.Invoke(_controller, null);
|
||||
Assert.That(_save.Load().campaignClearLanguages, Is.Empty);
|
||||
Assert.That(Get<bool>(_controller, "_campaignUnlocksSaved"), Is.False);
|
||||
Assert.That(Get<string>(_controller, "_campaignUnlockNotice"), Is.Null);
|
||||
Assert.That(Get<string>(_controller, "_campaignUnlockError"), Is.Not.Empty);
|
||||
Directory.Delete(_save.BackupPath);
|
||||
persist.Invoke(_controller, null);
|
||||
Assert.That(_save.Load().campaignClearLanguages, Is.EquivalentTo(new[] { Language.C }));
|
||||
Assert.That(Get<string>(_controller, "_campaignUnlockNotice"), Does.Contain("C++"));
|
||||
Assert.That(_run.RewardsSettled, Is.False, "Unlocking must not bank or finish the run.");
|
||||
Assert.That(_run.IsRunActive, Is.True);
|
||||
string committed = File.ReadAllText(_save.SavePath);
|
||||
_run.Journey.endless = true;
|
||||
persist.Invoke(_controller, null);
|
||||
Assert.That(File.ReadAllText(_save.SavePath), Is.EqualTo(committed));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CampaignVictorySaveFailureCanRetryWithoutDuplicateRewardsOrHistory()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user