Class AchievementManifestJsonExportTests
Tests for the JSON shape of AchievementManifestExporter: the complete dump a pipeline reads when it wants every field and no storefront's opinion.
Inherited Members
Namespace: Serenity.Achievements.Tests.Authoring
Assembly: Tests.dll
Syntax
public class AchievementManifestJsonExportTests
Remarks
Separated from the CSV tests because the question is different. A CSV is checked as a golden string, which proves the bytes are the expected ones and says nothing about whether they parse; JSON is checked both ways — once against the exact text, and once by parsing it back with a real reader and comparing the values, which is the only assertion that survives a change to how the file is laid out.
Constructors
AchievementManifestJsonExportTests()
Declaration
public AchievementManifestJsonExportTests()
Methods
Export_EscapesQuotesNewlinesAndBackslashesInKeys()
Declaration
public void Export_EscapesQuotesNewlinesAndBackslashesInKeys()
Export_KeepsAnUnassignedTrophyGradeRatherThanSkippingIt()
The opposite of the PlayStation sheet, which refuses an ungraded trophy: nothing downstream of a dump has claimed to be PlayStation, so the raw value goes out as it stands.
Declaration
public void Export_KeepsAnUnassignedTrophyGradeRatherThanSkippingIt()
Export_LeavesOutAnAchievementTheAuthoringRulesReject()
The one storefront opinion the dump does keep. An achievement the authoring rules reject is not one the project stands behind, and a dump is read as the project's answer about itself.
Declaration
public void Export_LeavesOutAnAchievementTheAuthoringRulesReject()
Export_OfNoAchievementsParsesAsAnEmptyArray()
Declaration
public void Export_OfNoAchievementsParsesAsAnEmptyArray()
Export_OfNothingButBrokenAchievementsIsAnEmptyArray()
Declaration
public void Export_OfNothingButBrokenAchievementsIsAnEmptyArray()
Export_OfOneAchievementParsesBackIntoItsFields()
Declaration
public void Export_OfOneAchievementParsesBackIntoItsFields()
Export_OfThreeAchievementsParsesIntoThreeObjectsInIdOrder()
Declaration
public void Export_OfThreeAchievementsParsesIntoThreeObjectsInIdOrder()
Export_RoundTripsTheWholeRangeOfAPointsAward()
Points stays a bare number: an int is held exactly by the double a JSON reader parses into.
Declaration
public void Export_RoundTripsTheWholeRangeOfAPointsAward()
Export_RoundTripsTheWholeRangeOfAProgressTarget()
Why the progress target is quoted: a bare JSON number goes through an IEEE-754 double on the way back, which cannot hold a long past 2^53. This is the assertion that would fail if someone "tidied" the quotes away.
Declaration
public void Export_RoundTripsTheWholeRangeOfAProgressTarget()
Export_SeparatesObjectsWithCommas()
Declaration
public void Export_SeparatesObjectsWithCommas()
Export_WritesEveryFieldOfEveryAchievement()
Declaration
public void Export_WritesEveryFieldOfEveryAchievement()