Example #1
0
        public void ReturnAssertExceptionForNotMatchingResponseThatContainsListOfValueType()
        {
            //--Arrange
            var expectedResult = new TestObjectThatContainsListOfValueType()
            {
                IntegerList = new List <int>
                {
                    1,
                    2,
                    3
                }
            };

            var returnedResult = new TestObjectThatContainsListOfValueType
            {
                IntegerList = new List <int>
                {
                    1,
                    3,
                    4
                }
            };

            var actionResult = new HttpGenericResult(new RidgidApiController(), HttpStatusCode.BadRequest, returnedResult);

            //--Act/Assert
            Should.Throw <ShouldAssertException>(() => actionResult.BetterBe(HttpStatusCode.BadRequest, expectedResult));
        }
Example #2
0
        public void NotThrowExceptionForMatchingResponseThatContainsListOfValueType()
        {
            //--Arrange
            var expectedResult = new TestObjectThatContainsListOfValueType()
            {
                IntegerList = new List <int>
                {
                    1,
                    2,
                    3
                }
            };

            var actionResult = new HttpGenericResult(new RidgidApiController(), HttpStatusCode.BadRequest, expectedResult);

            //--Act/Assert
            actionResult.BetterBe(HttpStatusCode.BadRequest, expectedResult);
        }