Program.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Linq;
  6. using System.Reactive.Linq;
  7. using System.Reflection;
  8. namespace ApiCompare
  9. {
  10. class Program
  11. {
  12. static void Main()
  13. {
  14. var observable = typeof(Observable).GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m.Name).Distinct();
  15. var asyncObservable = typeof(AsyncObservable).GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m.Name).Distinct();
  16. var exclude = new[]
  17. {
  18. "AsObservable", // Trivially renamed to AsAsyncObservable.
  19. "ToObservable", // Trivially renamed to ToAsyncObservable.
  20. "Subscribe", // Trivially renamed to SubscribeAsync.
  21. "If", // Postponing imperative operators.
  22. "DoWhile", // Postponing imperative operators.
  23. "Case", // Postponing imperative operators.
  24. "For", // Postponing imperative operators.
  25. "While", // Postponing imperative operators.
  26. "Collect", // Postponing push-to-pull adapters.
  27. "Chunkify", // Postponing push-to-pull adapters.
  28. "GetEnumerator", // Postponing push-to-pull adapters.
  29. "Latest", // Postponing push-to-pull adapters.
  30. "MostRecent", // Postponing push-to-pull adapters.
  31. "Next", // Postponing push-to-pull adapters.
  32. "ToEnumerable", // Postponing push-to-pull adapters.
  33. "ForEach", // Deprecating blocking functionality.
  34. "Wait", // Deprecating blocking functionality.
  35. };
  36. var missing = observable.Except(exclude).Except(asyncObservable).OrderBy(m => m);
  37. foreach (var m in missing)
  38. {
  39. Console.WriteLine(m);
  40. }
  41. Console.WriteLine();
  42. Console.WriteLine("Count = " + missing.Count());
  43. }
  44. }
  45. }