Created
February 1, 2017 04:03
-
-
Save jamiepollock/75419a861ab9a907e1977d3a490be3b0 to your computer and use it in GitHub Desktop.
Tests for Decimal conversion in Umbraco Ditto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using NUnit.Framework; | |
using Our.Umbraco.Ditto.Tests.Mocks; | |
namespace Our.Umbraco.Ditto.Tests | |
{ | |
[TestFixture] | |
[Category("Processors")] | |
public class DecimalTests | |
{ | |
public class MyModel | |
{ | |
public decimal Threshold { get; set; } | |
} | |
[TestCase("-0.5")] | |
[TestCase(-0.5)] | |
public void DecimalsCanBeNegative(object value) | |
{ | |
var content = new MockPublishedContent | |
{ | |
Properties = new [] | |
{ | |
new MockPublishedContentProperty("Threshold", value) | |
} | |
}; | |
var model = content.As<MyModel>(); | |
Assert.AreEqual(-0.5, model.Threshold); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment