mirror of
https://github.com/mgroves/MonodroidStockPortfolio.git
synced 2025-01-04 03:00:20 +00:00
28 lines
No EOL
880 B
C#
28 lines
No EOL
880 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Machine.Specifications;
|
|
using MonoStockPortfolio.Activites.EditPortfolioScreen;
|
|
using MonoStockPortfolio.Framework;
|
|
|
|
namespace MonoStockPortfolio.Tests.Framework
|
|
{
|
|
public class ValidationTests
|
|
{
|
|
static NewFormValidator _validator;
|
|
static IEnumerable<string> _errors;
|
|
|
|
Establish context = () =>
|
|
{
|
|
_validator = new NewFormValidator();
|
|
};
|
|
|
|
Because of = () =>
|
|
{
|
|
_validator.AddRequired(() => "", "This is required");
|
|
_errors = _validator.Apply();
|
|
};
|
|
|
|
It should_return_1_error_message = () =>
|
|
_errors.Count().ShouldEqual(1);
|
|
}
|
|
} |