Skip to content

Commit

Permalink
Added a test to make sure an error is thrown if the size is not valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstebo committed Feb 5, 2019
1 parent b9f3982 commit 09a1319
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/FakerDotNet.Tests/Fakers/LoremFlickrFakerTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using FakeItEasy;
using FakerDotNet.Fakers;
using NUnit.Framework;
Expand Down Expand Up @@ -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<ArgumentException>(() =>
_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()
{
Expand Down

0 comments on commit 09a1319

Please sign in to comment.