Ad

C# 7.0+ features allow for syntatic sugar to reduce coding length. As well, the tests were using Is.Equal when Is.True and Is.False exist.

Code
Diff
  • namespace Solution 
    {
      using System;
      
      public static class logic
      {
        public static bool  Or(bool i, bool j) => i.i() + j.i() >= 1;
        public static bool And(bool i, bool j) => i.i() + j.i() == 2;
        public static bool Xor(bool i, bool j) => i.i() + j.i() == 1;
      }
      
      public static class BoolExtensions
      {
        public static int i(this bool val) => Convert.ToInt32(val);
      }
    }
    • namespace Solution
    • {
    • using System;
    • public static class logic
    • {
    • public static bool Or(bool i, bool j) { return i.i() + j.i() >= 1; }
    • public static bool And(bool i, bool j) { return i.i() + j.i() == 2; }
    • public static bool Xor(bool i, bool j) { return i.i() + j.i() == 1; }
    • public static bool Or(bool i, bool j) => i.i() + j.i() >= 1;
    • public static bool And(bool i, bool j) => i.i() + j.i() == 2;
    • public static bool Xor(bool i, bool j) => i.i() + j.i() == 1;
    • }
    • public static class BoolExtensions
    • {
    • public static int i(this bool val)
    • {
    • return Convert.ToInt32(val);
    • }
    • public static int i(this bool val) => Convert.ToInt32(val);
    • }
    • }