Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inputfalken committed Jun 15, 2024
1 parent 45802e6 commit 59ede47
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ namespace DynamoDBGenerator.SourceGenerator.Tests.DynamoDBDocumentTests;
[DynamoDBMarshaller(EntityType = typeof((Guid, Guid)), AccessName = "INT", ArgumentType = typeof(int))]
public partial class PrimitiveArgumentTests
{
[Fact]
public void UnmarshallArgument_GUID_ShouldThrowInvalidOperationException()
{
var act = () => GUID.UnmarshallArgument(new Dictionary<string, AttributeValue>());

act.Should()
.Throw<InvalidOperationException>()
.WithMessage("Could not unmarshall the type 'Guid'*");
}

[Fact]
public void UnmarshallArgument_INT_ShouldThrowInvalidOperationException()
{
var act = () => INT.UnmarshallArgument(new Dictionary<string, AttributeValue>());

act.Should()
.Throw<InvalidOperationException>()
.WithMessage("Could not unmarshall the type 'Int32'*");
}

[Fact]
public void UnmarshallArgument_STRING_ShouldThrowInvalidOperationException()
{
var act = () => String.UnmarshallArgument(new Dictionary<string, AttributeValue>());

Check failure on line 34 in tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs

View workflow job for this annotation

GitHub Actions / build

'string' does not contain a definition for 'UnmarshallArgument'

Check failure on line 34 in tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs

View workflow job for this annotation

GitHub Actions / build

'string' does not contain a definition for 'UnmarshallArgument'

Check failure on line 34 in tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs

View workflow job for this annotation

GitHub Actions / build

'string' does not contain a definition for 'UnmarshallArgument'

Check failure on line 34 in tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs

View workflow job for this annotation

GitHub Actions / build

'string' does not contain a definition for 'UnmarshallArgument'

act.Should()
.Throw<InvalidOperationException>()
.WithMessage("Could not unmarshall the type 'String'*");
}

[Fact]
public void ExpressionValueTracker_STRING_ShouldBeExpandedCorrectly()
{
Expand Down

0 comments on commit 59ede47

Please sign in to comment.