AcornPublishing_essential-csharp-7e/EssentialCSharp-8.0/src/Chapter11.Tests/Listing11.01.ThrowingAnException.Tests.cs
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter11.Listing11_01.Tests
{
    [TestClass]
    public class TextNumberParserTests
    {
        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void Parse_GivenNull_ThrowsArgumentNullException()
        {
            TextNumberParser.Parse(null!);
        }

        [TestMethod]
        public void Parse_GivenOne_Returns1()
        {
            Assert.AreEqual<int>(1, TextNumberParser.Parse("one"));
        }
    }
}