Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AppFileInfo(response: CCloud_AppFileInfo) {
val rawFileSize: Int = response.rawFileSize
val persistState: ECloudStoragePersistState = response.persistState
val platformsToSync: Int = response.platformsToSync
val hasPathPrefixIndex: Boolean = response.hasPathPrefixIndex()
val pathPrefixIndex: Int = response.pathPrefixIndex
val machineNameIndex: Int = response.machineNameIndex
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package in.dragonbra.javasteam.steam.handlers.steamcloud;

import in.dragonbra.javasteam.protobufs.steamclient.SteammessagesCloudSteamclient;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class AppFileInfoTest {

@Test
public void hasPathPrefixIndexIsFalseWhenFieldIsMissing() {
var response = SteammessagesCloudSteamclient.CCloud_AppFileInfo.newBuilder()
.setFileName("save.dat")
.build();

var info = new AppFileInfo(response);

Assertions.assertFalse(info.getHasPathPrefixIndex());
}

@Test
public void hasPathPrefixIndexIsTrueWhenIndexIsZero() {
var response = SteammessagesCloudSteamclient.CCloud_AppFileInfo.newBuilder()
.setFileName("save.dat")
.setPathPrefixIndex(0)
.build();

var info = new AppFileInfo(response);

Assertions.assertTrue(info.getHasPathPrefixIndex());
Assertions.assertEquals(0, info.getPathPrefixIndex());
}
}
Loading