Beispiel #1
0
        public void ConflictObjectResult_SetsStatusCodeAndValue()
        {
            // Arrange & Act
            var obj = new object();
            var conflictObjectResult = new ConflictObjectResult(obj);

            // Assert
            Assert.Equal(StatusCodes.Status409Conflict, conflictObjectResult.StatusCode);
            Assert.Equal(obj, conflictObjectResult.Value);
        }
Beispiel #2
0
        public void ConflictObjectResult_ModelState_SetsStatusCodeAndValue()
        {
            // Arrange & Act
            var conflictObjectResult = new ConflictObjectResult(new ModelStateDictionary());

            // Assert
            Assert.Equal(StatusCodes.Status409Conflict, conflictObjectResult.StatusCode);
            var errors = Assert.IsType <SerializableError>(conflictObjectResult.Value);

            Assert.Empty(errors);
        }