public void WhenGetAllIsCalled_AllConstantsAreReturned() { var constants = TestableConstant.GetAll(); Assert.Equal(new List <TestableConstant> { TestableConstant.Default, TestableConstant.Constant1 }, constants); }
public void GivenKeyDoesNotExistInConstants_WhenGetOrDefaultForIsCalled_DefaultConstantIsReturned() { var constant = TestableConstant.GetOrDefaultFor("notExistsingKey"); Assert.Equal(TestableConstant.Default, constant); }
public void GivenKeyDoesNotExistInConstants_WhenGetForIsCalled_ExceptionIsThrown() { Assert.Throws <KeyNotFoundException>(() => TestableConstant.GetFor("notExistsingKey")); }
public void GivenKeyIsNull_WhenGetForIsCalled_ExceptionIsThrown() { Assert.Throws <ArgumentNullException>(() => TestableConstant.GetFor(null)); }
public void GivenKeyDoesExistInConstants_WhenGetForIsCalled_TheConstantIsReturned() { var constant = TestableConstant.GetFor("constant1"); Assert.Equal(TestableConstant.Constant1, constant); }