-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port linter rule secure-params-in-nested-deploy
- Loading branch information
Stephen Weatherford
authored and
Stephen Weatherford
committed
Jul 28, 2022
1 parent
8e74bc9
commit c317dc3
Showing
26 changed files
with
1,181 additions
and
76 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
42 changes: 42 additions & 0 deletions
42
src/Bicep.Core.UnitTests/AssertionsTests/StringAssertionsExtensionsTests.cs
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,42 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using Bicep.Core.UnitTests.Assertions; | ||
using FluentAssertions; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Collections.Generic; | ||
using System; | ||
|
||
namespace Bicep.Core.UnitTests.AssertionsTests | ||
{ | ||
[TestClass] | ||
public class StringAssertionsExtensionsTests | ||
{ | ||
[DataRow( | ||
"hello there", | ||
new[] { "Hello", "Dolly" }, | ||
StringComparison.InvariantCulture, | ||
null)] | ||
[DataRow( | ||
"hello there", | ||
new[] { "Hello", "Dolly" }, | ||
StringComparison.InvariantCultureIgnoreCase, | ||
"Did not expect string \"hello there\" to contain any of the strings: {\"Hello\"} because I said so.")] | ||
[DataTestMethod] | ||
public void NotContainAny_WithStringComparison(string text, IEnumerable<string> values, StringComparison stringComparison, string? expectedFailureMessage) | ||
{ | ||
string? actualMessage; | ||
try | ||
{ | ||
text.Should().NotContainAny(values, stringComparison, "because I said so"); | ||
actualMessage = null; | ||
} | ||
catch (Exception ex) | ||
{ | ||
actualMessage = ex.Message; | ||
} | ||
|
||
actualMessage.Should().Be(expectedFailureMessage); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.