Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Samples] Sort the files under samples/Tests by version #3019

Merged
merged 9 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Here are some cool photos",
"size": "large"
},
{
"type": "TextBlock",
"text": "Sorry some of them are repeats",
"size": "medium",
"weight": "lighter"
},
{
"type": "ImageSet",
"imageSize": "auto",
"images": [
{
"type": "Image",
"url": "https://picsum.photos/200/200?image=100"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=200"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=301"
},
{
"type": "Image",
"url": "https://picsum.photos/200/200?image=400"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=500"
},
{
"type": "Image",
"url": "https://picsum.photos/200/200?image=600"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=700"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=800"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=900"
}
]
}
]
}
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Here are some cool photos",
"size": "large"
},
{
"type": "TextBlock",
"text": "Sorry some of them are repeats",
"size": "medium",
"weight": "lighter"
},
{
"type": "ImageSet",
"imageSize": "auto",
"images": [
{
"type": "Image",
"url": "https://picsum.photos/200/200?image=100"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=200"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=301"
},
{
"type": "Image",
"url": "https://picsum.photos/200/200?image=400"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=500"
},
{
"type": "Image",
"url": "https://picsum.photos/200/200?image=600"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=700"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=800"
},
{
"type": "Image",
"url": "https://picsum.photos/300/200?image=900"
}
]
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 17 additions & 24 deletions source/dotnet/Test/AdaptiveCards.Test/AllPayloadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void TestPayloadsInDirectory(string path, string[] excludedCards)
{
// If the card is excluded we might not parse properly
// skip it if there was a parse failure.
if(!excluded)
if (!excluded)
{
throw;
}
Expand Down Expand Up @@ -94,46 +94,39 @@ private void TestPayloadsInDirectory(string path, string[] excludedCards)
public void TestAllScenarios()
{
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.0", "scenarios"), null);
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.1", "scenarios"), null);
}

[TestMethod]
public void TestAllElements()
{
// TODO: bring this test back once I investigate the warnings
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.0", "elements"),
new string[]
{
"Container.Style",
"Action.ShowCard.Style"
});
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.0", "elements"), null);
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.1", "elements"), null);
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.2", "elements"), null);
}

[TestMethod]
public void TestAllTestCards()
{
// List of json payloads that are expected to fail parsing
TestPayloadsInDirectory(Path.Combine(SamplesPath, "tests"),

TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.0", "tests"),
new string[]
{
{
// These cards are expected to fail
"AdaptiveCard.UnknownElements",
"AdditionalProperty",
"CustomParsingTestUsingProgressBar",
"TypeIsRequired",
"AdaptiveCard.MinVersion",
"AdaptiveCard.MissingVersion",
"AdaptiveCard.Version1.3",
"FlightItinerary_es_fail",
});

TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.1", "tests"), null);
TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.2", "tests"),
new string[]
{
// These cards are expected to fail
"Action.DuplicateIds",
"Action.NestedDuplicateIds",
"Action.CustomParsing",

// These are cards that features haven't been implemented yet
// <this space intentionally blank>

// These cards have AdaptiveCards with styles on them
"ColumnColumnSetContainer.Bleed",
});

TestPayloadsInDirectory(Path.Combine(SamplesPath, "v1.3", "tests"), null);
}
}
}
Loading