예제 #1
0
        // 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);
            }
        }
예제 #5
0
 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.")));
 }
예제 #6
0
 public EnumCounter(SomeEnum val)
 {
     Value = val;
 }
예제 #7
0
 public void An_enum_is_serialized()
 {
     _value = SomeEnum.Superior;
     _body = Subject.Serialize(_value);
 }
 public ObjectPrintable()
 {
     SomeEnumMember = SomeEnum.Enum22;
 }
예제 #9
0
 public void When_getting_selected_option_value()
 {
     _result = Page.RequiredEnumDropDownSelectedValue;
 }
 public ServiceToTestOverrides(SomeEnum someEnum, IService2 service, Argument argument)
 {
     _someEnum = someEnum;
     _service  = service;
     _argument = argument;
 }