-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating logging property and update string manipulation (#208)
* Updating logging property and update string manipulation * Address PR comment --------- Co-authored-by: elvilla <elvilla@microsoft.com>
- Loading branch information
1 parent
48f75ad
commit da3ea55
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// -------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
// -------------------------------------------------------------------------------------------- | ||
|
||
using Microsoft.BridgeToKubernetes.Common.Utilities; | ||
using Xunit; | ||
|
||
namespace Microsoft.BridgeToKubernetes.Common.Tests.Utilities | ||
{ | ||
public class StringManipulationTests | ||
{ | ||
[Theory] | ||
[InlineData("BEGIN PRIVATE KEY\nuirethweuifhewiufhweiuofhweo\njweiorjweoifnewouhfousdgherufhsdiuhEND PRIVATE KEY\n", "KEY_WAS_REMOVED\n")] | ||
[InlineData("iurhuweifhoBEGIN PRIVATE KEY\nuirethweuifhewiufhweiuofhweo\njweiorjweoifnewouhfousdgherufhsdiuhEND PRIVATE KEY\n", "iurhuweifhoKEY_WAS_REMOVED\n")] | ||
[InlineData("BEGIN PRIVATE KEYb2kkkkkkkkkkkkkkEND PRIVATE KEY", "KEY_WAS_REMOVED")] | ||
[InlineData("hello world", "hello world")] | ||
[InlineData("BEGIN PRIVATE KEY\nuirethweuifhewiufhweiuofhweo\njweiorjweoifnewouhfousdgherufhsdiuhEND PRIVATE KEY", "KEY_WAS_REMOVED")] | ||
public void RemovePrivateKeyIfNeededTest(string input, string expected) | ||
{ | ||
Assert.True(string.Equals(StringManipulation.RemovePrivateKeyIfNeeded(input), expected)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters