Program.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. "FirstAsync", // Renamed to drop the Async suffix.
  20. "FirstOrDefaultAsync", // Renamed to drop the Async suffix.
  21. "LastAsync", // Renamed to drop the Async suffix.
  22. "LastOrDefaultAsync", // Renamed to drop the Async suffix.
  23. "SingleAsync", // Renamed to drop the Async suffix.
  24. "SingleOrDefaultAsync", // Renamed to drop the Async suffix.
  25. "And", // Postponing patterns.
  26. "Then", // Postponing patterns.
  27. "When", // Postponing patterns.
  28. "If", // Postponing imperative operators.
  29. "DoWhile", // Postponing imperative operators.
  30. "Case", // Postponing imperative operators.
  31. "For", // Postponing imperative operators.
  32. };
  33. var missing = observable.Except(exclude).Except(asyncObservable).OrderBy(m => m);
  34. foreach (var m in missing)
  35. {
  36. Console.WriteLine(m);
  37. }
  38. Console.WriteLine();
  39. Console.WriteLine("Count = " + missing.Count());
  40. }
  41. }
  42. }