From 09a1319787ddc992b58ecc722cbde1813b96564f Mon Sep 17 00:00:00 2001 From: Steve Atkinson Date: Tue, 5 Feb 2019 17:16:41 +0000 Subject: [PATCH] Added a test to make sure an error is thrown if the size is not valid. --- .../FakerDotNet.Tests/Fakers/LoremFlickrFakerTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/FakerDotNet.Tests/Fakers/LoremFlickrFakerTests.cs b/tests/FakerDotNet.Tests/Fakers/LoremFlickrFakerTests.cs index ea99710..41e6dd8 100644 --- a/tests/FakerDotNet.Tests/Fakers/LoremFlickrFakerTests.cs +++ b/tests/FakerDotNet.Tests/Fakers/LoremFlickrFakerTests.cs @@ -1,3 +1,4 @@ +using System; using FakeItEasy; using FakerDotNet.Fakers; using NUnit.Framework; @@ -34,6 +35,15 @@ public void Image_returns_an_image_url_with_the_specified_size() _loremflickrFaker.Image("50x60")); } + [Test] + public void Image_throws_ArgumentException_when_size_is_not_in_a_valid_format() + { + var ex = Assert.Throws(() => + _loremflickrFaker.Image("ABCxDEF")); + + Assert.That(ex.Message.StartsWith("Size should be specified in format 300x300")); + } + [Test] public void Image_returns_an_image_url_with_the_specified_search_term() {