public void GetName_TestEnum_ThirdElement() { // Arrange TestEnum enumToTest = TestEnum.ThirdElement; // Act string actualResults = enumToTest.GetName(); // Assert Assert.AreEqual("ThirdElement", actualResults); }
private CaseModel ExeEvent_Random_Select_Item() { return(new CaseModel() { NameSign = @"随机选项", ExeEvent = () => { TestEnum[] source = ConvertTool.EnumForeachArray <TestEnum>(); foreach (TestEnum item in source) { Print.WriteLine(string.Format("Name: {0} Value: {1}", item.GetName(), item.GetIntValue())); } Print.WriteLine("随机筛选的值: "); TestEnum random_selitem = RandomData.Item(source); Print.WriteLine(string.Format("Name: {0} Value: {1}", random_selitem.GetName(), random_selitem.GetIntValue())); }, }); }
public void GetName(TestEnum testValue, string expected) { testValue.GetName().ShouldBe(expected); }