// switch generation public void M(SomeEnum e) { switch (e) { } }
private void GivenANullableEnumExample(SomeEnum? nullableEnum) { }
public void When_getting_selected_option_value() { _result = Page.RequiredEnumDropDownSelectedValue; }
static void CheckValue(SomeEnum val, params byte[] expected) { EnumFoo foo = new EnumFoo { Bar = val }; using (MemoryStream ms = new MemoryStream()) { Serializer.Serialize(ms, foo); ms.Position = 0; byte[] buffer = ms.ToArray(); Assert.IsTrue(Program.ArraysEqual(buffer, expected), "Byte mismatch"); EnumFoo clone = Serializer.Deserialize<EnumFoo>(ms); Assert.AreEqual(val, clone.Bar); } }
public static string ConvertSomeEnumToString(SomeEnum value) { if ((value == SomeEnum.Value1)) { return "Value1"; } if ((value == SomeEnum.Value2)) { return "Value2"; } if ((value == SomeEnum.Value3)) { return "Value3"; } throw new System.Exception(("Could not convert SomeEnum value " + (value + " to string."))); }
public EnumCounter(SomeEnum val) { Value = val; }
public void An_enum_is_serialized() { _value = SomeEnum.Superior; _body = Subject.Serialize(_value); }
public ObjectPrintable() { SomeEnumMember = SomeEnum.Enum22; }
public ServiceToTestOverrides(SomeEnum someEnum, IService2 service, Argument argument) { _someEnum = someEnum; _service = service; _argument = argument; }