none
Cannot convert lambda expression to type 'Microsoft.Reactive.Testing.Recorded<System.Reactive.Notification<object>>' because it is not a delegate type

    Question

  • Cannot convert lambda expression to type 'Microsoft.Reactive.Testing.Recorded<System.Reactive.Notification<object>>' because it is not a delegate type

    var scheduler = new TestScheduler();
    
                var xs2 = scheduler.CreateColdObservable<Object>(
                    x => Task1(), //error at here
                    Task1Completed()
                );
                    
                var observer1 = scheduler.CreateObserver<Object>();
                scheduler.Schedule(TimeSpan.FromTicks(190), () => xs2.Subscribe(observer1));
    
                var observer2 = scheduler.CreateObserver<Object>();
                scheduler.Schedule(TimeSpan.FromTicks(220), () => xs2.Subscribe(observer2));
    
                scheduler.Start();

     public static void Task1(Object o)
            {
                Console.WriteLine("Task1");
            }
            public static void Task1Error()
            {
                Console.WriteLine("Task1 Error");
            }
            public static void Task1Completed()
            {
                Console.WriteLine("Task1 Completed");
            }
            public static void Task2(Object o)
            {
                Console.WriteLine("Task2");
            }

    Friday, February 14, 2014 8:17 AM