public void TestEnum() { var t = new TestClassWithEnum(TestDirection.DOWN); var json = Piekson.ToJson(t); Assert.AreEqual("{\"TestDirection\":\"DOWN\"}", json); }
public void TestSystemEnumLinqToLcsWithoutVariable() { var exception = Xunit.Record.Exception(() => { // Arrange. var testProvider = new TestLcsQueryProvider <TestClassWithEnum>(); var predicate1 = (Expression <Func <TestClassWithEnum, bool> >)(o => o.PoleEnum == DayOfWeek.Saturday); new Query <TestClassWithEnum>(testProvider).Where(predicate1).ToArray(); Expression queryExpression = testProvider.InnerExpression; // Act. LoadingCustomizationStruct actual = LinqToLcs.GetLcs(queryExpression, TestClassWithEnum.GetView()); }); Assert.IsType(typeof(FunctionalLanguageDef.NotFoundFunctionParametersException), exception); }