protected override System.Collections.Generic.IDictionary <string, object> GetTestArguments()
        {
            var result = base.GetTestArguments();

            SetRpcError(result, RpcError.CustomError("Test.ApplicationError", 1));                 // Dummy random
            return(result);
        }
Esempio n. 2
0
        public void TestEquals_NotRpcError_False()
        {
            var left  = RpcError.CustomError("ID", 1);
            var right = "ID";

            Assert.That(left.Equals(right), Is.False);
        }
Esempio n. 3
0
        public void TestEquals_Null_False()
        {
            var      left  = RpcError.CustomError("ID", 1);
            RpcError right = null;

            Assert.That(left.Equals(right), Is.False);
            Assert.That(left == right, Is.False);
            Assert.That(right == left, Is.False);
            Assert.That(left != right, Is.True);
            Assert.That(right != left, Is.True);
        }
Esempio n. 4
0
        public void TestCustomError_NonNullId_ZeroErrorCode_AsIs()
        {
            var identifier = Guid.NewGuid().ToString();
            var errorCode  = 0;
            var target     = RpcError.CustomError(identifier, errorCode);

            Assert.That(target, Is.Not.Null);
            Assert.That(target.Identifier, Is.EqualTo(identifier));
            Assert.That(target.ErrorCode, Is.EqualTo(errorCode));
            Assert.That(target.DefaultMessage, Is.Not.Null.And.Not.Empty);
            Assert.That(target.DefaultMessageInvariant, Is.Not.Null.And.Not.Empty);
        }
Esempio n. 5
0
        public void TestEquals_DifferId_DifferCode_False()
        {
            var left  = RpcError.CustomError("ID", 1);
            var right = RpcError.CustomError("ID0", 2);

            Assert.That(left.Equals(right), Is.False);
            Assert.That(right.Equals(left), Is.False);
            Assert.That(left == right, Is.False);
            Assert.That(right == left, Is.False);
            Assert.That(left != right, Is.True);
            Assert.That(right != left, Is.True);
        }
Esempio n. 6
0
        public void TestEquals_SameId_SameCode_True()
        {
            var left  = RpcError.CustomError("ID", 1);
            var right = RpcError.CustomError("ID", 1);

            Assert.That(left, Is.Not.SameAs(right), "Precondition");
            Assert.That(left.Equals(right), Is.True);
            Assert.That(right.Equals(left), Is.True);
            Assert.That(left == right, Is.True);
            Assert.That(right == left, Is.True);
            Assert.That(left != right, Is.False);
            Assert.That(right != left, Is.False);
        }
Esempio n. 7
0
 public void TestCustomError_NoNullId_UnasignedNegative()
 {
     var target = RpcError.CustomError("A", -1);
 }
Esempio n. 8
0
 public void TestCustomError_WhiteSpaceId()
 {
     var target = RpcError.CustomError(" ", 0);
 }
Esempio n. 9
0
 public void TestCustomError_EmptyId()
 {
     var target = RpcError.CustomError(String.Empty, 0);
 }
Esempio n. 10
0
 public void TestCustomError_NullId()
 {
     var target = RpcError.CustomError(null, 0);
 }