public void When_building_by_name_Then_returns_proper_distance() { var actual = Distance.BuildByName("Kilometers", 25); Assert.That(actual, Is.InstanceOf <Kilometers>()); Assert.That(actual.Value, Is.EqualTo(25)); var actual2 = Distance.BuildByName("Miles", 25); Assert.That(actual2, Is.InstanceOf <Miles>()); Assert.That(actual2.Value, Is.EqualTo(25)); }
public void When_building_by_name_with_invalid_name_Then_throws_not_supported() { Assert.Throws <NotSupportedException>(() => Distance.BuildByName("LolWhat", 25)); }