mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
- Default `0` for legacy jobs. - Standardize job creation prior to registration. - Add `RightsHelper.TypeToRight()`.
28 lines
667 B
C#
28 lines
667 B
C#
using System;
|
|
using System.Linq;
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace Tgstation.Server.Api.Models.Tests
|
|
{
|
|
[TestClass]
|
|
public sealed class TestJobCode
|
|
{
|
|
[TestMethod]
|
|
public void TestAllCodesHaveDescription()
|
|
{
|
|
var jobCodeType = typeof(JobCode);
|
|
foreach (var code in Enum.GetValues(typeof(JobCode)).Cast<JobCode>())
|
|
Assert.IsFalse(
|
|
String.IsNullOrWhiteSpace(
|
|
jobCodeType
|
|
.GetField(code.ToString())
|
|
.GetCustomAttributes(false)
|
|
.OfType<System.ComponentModel.DescriptionAttribute>()
|
|
.FirstOrDefault()
|
|
?.Description),
|
|
$"JobCode {code} is missing a description!");
|
|
}
|
|
}
|
|
}
|