Skip to content

Commit 58f51a7

Browse files
committed
Update CloudSyncValidator tests for client-agnostic API design
Tests now expect no warning when remote format is null/empty, matching the client-agnostic API behavior where format is determined by the client, not the server.
1 parent 0b46aa9 commit 58f51a7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

LocalizationManager.Tests/UnitTests/Cloud/CloudSyncValidatorTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -543,33 +543,33 @@ public void SyncValidationResult_WithBothErrorAndWarning_CannotSync()
543543
#region Edge Cases
544544

545545
[Fact]
546-
public void ValidateForPush_EmptyRemoteFormat_ReturnsWarning()
546+
public void ValidateForPush_EmptyRemoteFormat_AllowsSync()
547547
{
548-
// Arrange
548+
// Arrange - API is client-agnostic, format is determined by client
549549
var localConfig = new ConfigurationModel { ResourceFormat = "resx", DefaultLanguageCode = "en" };
550550
var remoteProject = new CloudProject { Format = "", DefaultLanguage = "en" };
551551

552552
// Act
553553
var result = _validator.ValidateForPush(localConfig, remoteProject);
554554

555-
// Assert
556-
Assert.True(result.CanSync); // Empty format is a warning, not an error
557-
Assert.Contains(result.Warnings, w => w.Contains("Remote project format is not set"));
555+
// Assert - No warning when format is empty (client-agnostic API design)
556+
Assert.True(result.CanSync);
557+
Assert.Empty(result.Warnings);
558558
}
559559

560560
[Fact]
561-
public void ValidateForPush_NullRemoteFormat_ReturnsWarning()
561+
public void ValidateForPush_NullRemoteFormat_AllowsSync()
562562
{
563-
// Arrange
563+
// Arrange - API is client-agnostic, format is determined by client
564564
var localConfig = new ConfigurationModel { ResourceFormat = "resx", DefaultLanguageCode = "en" };
565565
var remoteProject = new CloudProject { Format = null!, DefaultLanguage = "en" };
566566

567567
// Act
568568
var result = _validator.ValidateForPush(localConfig, remoteProject);
569569

570-
// Assert
570+
// Assert - No warning when format is null (client-agnostic API design)
571571
Assert.True(result.CanSync);
572-
Assert.Contains(result.Warnings, w => w.Contains("Remote project format is not set"));
572+
Assert.Empty(result.Warnings);
573573
}
574574

575575
[Fact]

0 commit comments

Comments
 (0)