-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created VerifyAllColumnsBound check (#1949)
- Loading branch information
1 parent
61cf6cf
commit d233b2a
Showing
8 changed files
with
195 additions
and
17 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,10 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace TechTalk.SpecFlow.Assist | ||
{ | ||
public class InstanceCreationOptions | ||
{ | ||
public bool VerifyAllColumnsBound { get; set; } | ||
} | ||
} |
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
55 changes: 55 additions & 0 deletions
55
TechTalk.SpecFlow/ErrorHandling/ColumnCouldNotBeBoundException.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,55 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
|
||
// the exceptions are part of the public API, keep them in TechTalk.SpecFlow namespace | ||
namespace TechTalk.SpecFlow | ||
{ | ||
[Serializable] | ||
public class ColumnCouldNotBeBoundException : Exception | ||
{ | ||
public IList<string> Columns { get; } | ||
|
||
/// <inheritdoc /> | ||
public ColumnCouldNotBeBoundException() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public ColumnCouldNotBeBoundException(IList<string> columns) : base(CreateMessage(columns)) | ||
{ | ||
Columns = columns; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public ColumnCouldNotBeBoundException(string message, IList<string> columns) : base(message) | ||
{ | ||
Columns = columns; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public ColumnCouldNotBeBoundException(string message, Exception innerException, IList<string> columns) : base(message, innerException) | ||
{ | ||
Columns = columns; | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected ColumnCouldNotBeBoundException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
} | ||
|
||
private static string CreateMessage(IList<string> columns) | ||
{ | ||
if (columns.Count == 1) | ||
{ | ||
return $"Member or field {string.Join(",", columns)} not found"; | ||
} | ||
return $"Members or fields {string.Join(",", columns)} not found"; | ||
|
||
} | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
...TechTalk.SpecFlow.RuntimeTests/AssistTests/ExampleEntities/PersonWithMandatoryLastName.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,13 @@ | ||
using System; | ||
|
||
namespace TechTalk.SpecFlow.RuntimeTests.AssistTests.ExampleEntities | ||
{ | ||
class PersonWithMandatoryLastName : Person | ||
{ | ||
/// <inheritdoc /> | ||
public PersonWithMandatoryLastName(string lastName) | ||
{ | ||
LastName = lastName ?? throw new ArgumentNullException(nameof(lastName)); | ||
} | ||
} | ||
} |
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