using System; using Developpez.Dotnet.Algorithms; using NUnit.Framework; namespace Developpez.Dotnet.Tests.Algorithms { [TestFixture] public class SirenTests { [Test] public void CheckStandard() { Assert.AreEqual(true, Siren.Check("732829320")); Assert.AreEqual(false, Siren.Check("732829321")); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void CheckEmpty() { Siren.Check(string.Empty); } [Test] [ExpectedException(typeof(ArgumentException))] public void CheckZero() { Siren.Check("0"); } [Test] [ExpectedException(typeof(ArgumentException))] public void CheckLength() { Siren.Check("1"); } [Test] [ExpectedException(typeof(ArgumentException))] public void CheckNotANumberString() { Siren.Check("Foo"); } } }