public void TryRemapFromInt_ShouldSucceedAndReturnDegree_WhenConvertingFromMasters7() { bool success = ApprenticeshipLevelHelper.TryRemapFromInt(7, out ApprenticeshipLevel result); success.Should().Be(true); result.Should().Be(ApprenticeshipLevel.Degree); }
public void TryRemapFromInt_ShouldSucceedAndReturnHigher_WhenConvertingFromFoundation5() { bool success = ApprenticeshipLevelHelper.TryRemapFromInt(5, out ApprenticeshipLevel result); success.Should().Be(true); result.Should().Be(ApprenticeshipLevel.Higher); }
public void TryRemapFromInt_ShouldFail_WhenPassedAnIntWithNoCorrespondingValue() { int intValueToConvert = (int)ApprenticeshipLevel.Degree + 2; bool success = ApprenticeshipLevelHelper.TryRemapFromInt(intValueToConvert, out ApprenticeshipLevel result); success.Should().Be(false); result.Should().Be(ApprenticeshipLevel.Unknown); }
public void TryRemapFromInt_ShouldSucceedAndReturnEnum_WhenPassedAnIntWithCorrespondingValue() { var enumValues = Enum.GetValues(typeof(ApprenticeshipLevel)) .OfType <ApprenticeshipLevel>(); foreach (ApprenticeshipLevel enumValue in enumValues) { bool success = ApprenticeshipLevelHelper.TryRemapFromInt((int)enumValue, out ApprenticeshipLevel result); success.Should().Be(true); result.Should().Be(enumValue); } }