Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TestInt != 0)
            {
                hash ^= TestInt.GetHashCode();
            }
            if (TestFloat != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TestFloat);
            }
            if (TestDouble != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TestDouble);
            }
            if (TestBool != false)
            {
                hash ^= TestBool.GetHashCode();
            }
            hash ^= testIntArrays_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TestNum != 0)
            {
                hash ^= TestNum.GetHashCode();
            }
            if (TestFloat != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TestFloat);
            }
            if (TestString.Length != 0)
            {
                hash ^= TestString.GetHashCode();
            }
            if (TestBool != false)
            {
                hash ^= TestBool.GetHashCode();
            }
            hash ^= testList_.GetHashCode();
            hash ^= TestDic.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
    public ActionResult Index()
    {
        ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

        var t = new TestBool();

        return(View());
    }
Пример #4
0
        public void ShouldReturnValue()
        {
            //Arrange
            Bool subject = new TestBool();

            //Act
            bool actual = subject;

            //Assert
            actual.Should().BeTrue();
        }
Пример #5
0
        public void ShouldReturnFalseAsTrueAndFalse()
        {
            //Arrange
            Bool subject = new TestBool(true);

            //Act
            bool actual = subject.And(Bool.False);

            //Assert
            actual.Should().BeFalse();
        }
Пример #6
0
        public void ShouldReturnFalseAsFalse()
        {
            //Arrange
            Bool subject = new TestBool(false);

            //Act
            bool actual = subject;

            //Assert
            actual.Should().BeFalse();
        }
Пример #7
0
        public void Serialize_TestBool_CheckLength()
        {
            var tbClass = new TestBool();

            var ms = new MemoryStream();

            Serializer.Serialize(ms, tbClass);
            ms.Close();
            var b = ms.ToArray();

            Console.WriteLine($"b.Length {b.Length}");
            Console.WriteLine($"b {ByteArrayHelper.ByteArrayToString(b)}");
            Assert.That(b.Length, Is.EqualTo(2));
        }
Пример #8
0
        public void ItemShippedFalseTest()
        {
            //create an instance of the class we want to create
            clsOrder AnOrder = new clsOrder();
            //string variable to store any error message
            String Error = "";
            //create variable to store the Boolean
            Boolean TestBool;

            //set the Boolean to true
            TestBool = false;
            //convert the boolean variable to a string variable
            string ItemShipped = TestBool.ToString();

            //invoke the method
            Error = AnOrder.Valid(orderId, ItemName, Price, DateOrderMade, ItemShipped);
            //test to see the results are correct
            Assert.AreEqual(Error, "");
        }
 public ActionResult Index(TestBool t)
 {
     return(View("Index", t));
 }