Skip to content

Commit

Permalink
Remove default savefile free stuff
Browse files Browse the repository at this point in the history
- Add all 3* characters by default as was done on official servers
  • Loading branch information
SapiensAnatis committed Jul 16, 2023
1 parent e37f333 commit 9982413
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 400 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void SeedDatabase(IServiceProvider provider)
TestFixture.DeviceAccountId
);

savefileService.CreateBase().Wait();
savefileService.Create().Wait();

apiContext.PlayerMaterials.AddRange(
Enum.GetValues<Materials>()
Expand Down
3 changes: 3 additions & 0 deletions DragaliaAPI.Integration.Test/Features/GraphQL/GraphQlTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public async Task Query_PlayerCharacters_ReturnsExpectedResult()
)
)
);

response.Data.Player.CharaList.Should().Contain(x => x.CharaId == Charas.ThePrince);
response.Data.Player.CharaList.Should().Contain(x => x.CharaId == Charas.SummerMikoto);
}

[Fact]
Expand Down
76 changes: 2 additions & 74 deletions DragaliaAPI.Integration.Test/Other/DeleteSavefileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,79 +58,7 @@ public async Task Delete_LoadIndexResponseHasNewSavefile()
await this.Client.PostMsgpack<LoadIndexData>("load/index", new LoadIndexRequest())
).data;

// This test also provides us a good way to check out the default savefile
using (new AssertionScope())
{
storedSavefile.chara_list!
.Select(x => x.chara_id)
.Should()
.BeEquivalentTo(new List<Charas>() { Charas.ThePrince });

storedSavefile.party_list
.Should()
.HaveCount(54)
.And.AllSatisfy(x =>
{
x.party_name.Should().Be("Default");
x.party_setting_list
.Select(x => x.chara_id)
.Should()
.BeEquivalentTo(
new List<Charas>()
{
Charas.ThePrince,
Charas.Empty,
Charas.Empty,
Charas.Empty
}
);
});

storedSavefile.dragon_list!
.Select(x => x.dragon_id)
.Should()
.BeEquivalentTo(
DefaultSavefileData.Dragons.SelectMany(x => Enumerable.Repeat(x, 4))
);
storedSavefile.dragon_list!
.Should()
.AllSatisfy(
x =>
x.Should()
.BeEquivalentTo(
new DragonList()
{
level = 100,
limit_break_count = 4,
ability_1_level = 5,
ability_2_level = 5,
skill_1_level = 2,
attack_plus_count = 50,
hp_plus_count = 50,
exp = 1_240_020,
is_lock = false,
is_new = false
},
opts =>
opts.Excluding(x => x.dragon_id)
.Excluding(x => x.dragon_key_id)
.Excluding(x => x.get_time)
)
);
;
storedSavefile.dragon_reliability_list!
.Select(x => x.dragon_id)
.Should()
.BeEquivalentTo(DefaultSavefileData.Dragons);
storedSavefile.material_list!
.Select(x => x.material_id)
.Should()
.BeEquivalentTo(DefaultSavefileData.UpgradeMaterials);
storedSavefile.material_list!.Select(x => x.quantity).Should().AllBeEquivalentTo(10000);

storedSavefile.quest_story_list.Should().BeEmpty();
storedSavefile.castle_story_list.Should().BeEmpty();
storedSavefile.build_list.Should().BeEmpty();
}
storedSavefile.chara_list.Should().NotContain(x => x.chara_id == Charas.Ilia);
storedSavefile.chara_list.Should().NotContain(x => x.chara_id == Charas.DragonyuleIlia);
}
}
Loading

0 comments on commit 9982413

Please sign in to comment.