public void Methods_WorkWithDifferentTypes() { Assert.That(EnumeratedSubject.Values, Is.EqualTo(new[] { EnumeratedSubject.One, EnumeratedSubject.Two, EnumeratedSubject.Three })); Assert.That(AnotherEnumeratedSubject.Values, Is.EqualTo(new[] { AnotherEnumeratedSubject.One, AnotherEnumeratedSubject.Two, AnotherEnumeratedSubject.Three })); Assert.That(EnumeratedSubject.Parse("one"), Is.SameAs(EnumeratedSubject.One)); Assert.That(AnotherEnumeratedSubject.Parse("one"), Is.SameAs(AnotherEnumeratedSubject.One)); }
public void Parse_NonExistingValue_Exception() { Assert.That(() => EnumeratedSubject.Parse("nonExisting"), Throws.ArgumentException.With.Message.Contains("nonExisting")); }
public void Parse_ExistingValue_GivesTheValue() { EnumeratedSubject parsed = EnumeratedSubject.Parse("one"); Assert.That(parsed, Is.SameAs(EnumeratedSubject.One)); }