1
0

WireHackingTest.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using Content.Shared.Wires;
  4. using NUnit.Framework;
  5. using Robust.UnitTesting;
  6. namespace Content.Tests.Shared
  7. {
  8. // Making sure nobody forgets to set values for these wire colors/letters.
  9. // Also a thinly veiled excuse to bloat the test count.
  10. [TestFixture]
  11. public sealed class WireHackingTest : RobustUnitTest
  12. {
  13. public static IEnumerable<WireColor> ColorValues = (WireColor[]) Enum.GetValues(typeof(WireColor));
  14. public static IEnumerable<WireLetter> LetterValues = (WireLetter[]) Enum.GetValues(typeof(WireLetter));
  15. [Test]
  16. public void TestColorNameExists([ValueSource(nameof(ColorValues))] WireColor color)
  17. {
  18. Assert.DoesNotThrow(() => color.Name());
  19. }
  20. [Test]
  21. public void TestColorValueExists([ValueSource(nameof(ColorValues))] WireColor color)
  22. {
  23. Assert.DoesNotThrow(() => color.ColorValue());
  24. }
  25. [Test]
  26. public void TestLetterNameExists([ValueSource(nameof(LetterValues))] WireLetter letter)
  27. {
  28. Assert.DoesNotThrow(() => letter.Name());
  29. }
  30. [Test]
  31. public void TestLetterLetterExists([ValueSource(nameof(LetterValues))] WireLetter letter)
  32. {
  33. Assert.DoesNotThrow(() => letter.Letter());
  34. }
  35. }
  36. }