From 59ede472e735bf431eb184613d693b5b4a5e9e2d Mon Sep 17 00:00:00 2001 From: Robert Andersson Date: Sat, 15 Jun 2024 23:51:33 +0200 Subject: [PATCH] Add tests --- .../PrimitiveArgumentTests.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs b/tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs index a257c589..e638ccdd 100644 --- a/tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs +++ b/tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/PrimitiveArgumentTests.cs @@ -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()); + + act.Should() + .Throw() + .WithMessage("Could not unmarshall the type 'Guid'*"); + } + + [Fact] + public void UnmarshallArgument_INT_ShouldThrowInvalidOperationException() + { + var act = () => INT.UnmarshallArgument(new Dictionary()); + + act.Should() + .Throw() + .WithMessage("Could not unmarshall the type 'Int32'*"); + } + + [Fact] + public void UnmarshallArgument_STRING_ShouldThrowInvalidOperationException() + { + var act = () => String.UnmarshallArgument(new Dictionary()); + + act.Should() + .Throw() + .WithMessage("Could not unmarshall the type 'String'*"); + } + [Fact] public void ExpressionValueTracker_STRING_ShouldBeExpandedCorrectly() {