public void ToVersion_ShouldBe_1_8_0() { // Arrange var migration = new AppSettingsMigration(_storage); // Act var result = migration.ToVersion; // Assert result.Should().Be(new Version(1, 8, 0)); }
public void Apply_ShouldSet_OvpnProtocol_ToAuto(string previousValue) { // Arrange _storage.Get <string>("OvpnProtocol").Returns(previousValue); var migration = new AppSettingsMigration(_storage); // Act migration.Apply(); // Assert _storage.Received().Set("OvpnProtocol", "auto"); }
public void Apply_Should_NotSwitchOff_SplitTunnel_WhenKillSwitch_IsOff() { // Arrange _storage.Get <bool>("KillSwitch").Returns(false); _storage.Get <bool>("SplitTunnelingEnabled").Returns(true); var migration = new AppSettingsMigration(_storage); // Act migration.Apply(); // Assert _storage.DidNotReceive().Set("SplitTunnelingEnabled", Arg.Any <bool>()); }
public void Apply_Should_NotApplyMigration_OvpnProtocol_WhenUserSettingsVersion_Contains_1_10(bool migrated, string userSettingsVersion) { // Arrange _storage.Get <string>("UserSettingsVersion").Returns(userSettingsVersion); _storage.Get <string>("OvpnProtocol").Returns("udp"); var migration = new AppSettingsMigration(_storage); // Act migration.Apply(); // Assert if (migrated) { _storage.Received().Set("OvpnProtocol", "auto"); } else { _storage.DidNotReceive().Set("OvpnProtocol", Arg.Any <string>()); } }