1- using System ;
2- using System . Diagnostics ;
3- using FluentAssertions . Execution ;
4- using FluentAssertions . Primitives ;
1+ using FluentAssertions . Execution ;
52using Microsoft . AspNetCore . Mvc ;
3+ using System ;
4+ using System . Diagnostics ;
65
76namespace FluentAssertions . AspNetCore . Mvc
87{
98 /// <summary>
109 /// Contains a number of methods to assert that a <see cref="CreatedResult"/> is in the expected state.
1110 /// </summary>
1211 [ DebuggerNonUserCode ]
13- public class CreatedResultAssertions : ObjectAssertions
12+ public class CreatedResultAssertions : ObjectResultAssertionsBase < CreatedResult , CreatedResultAssertions >
1413 {
1514 #region Public Constructors
1615
@@ -26,42 +25,13 @@ public CreatedResultAssertions(CreatedResult subject) : base(subject)
2625
2726 #region Public Properties
2827 /// <summary>
29- /// The value on the CreatedResult
28+ /// The location on the CreatedResult.
3029 /// </summary>
31- public object Value => CreatedResultSubject . Value ;
32-
33- public string Location => CreatedResultSubject . Location ;
34-
35- #endregion
36-
37- #region Private Properties
38- private CreatedResult CreatedResultSubject => ( CreatedResult ) Subject ;
30+ public string Location => ObjectResultSubject . Location ;
3931
4032 #endregion
4133
4234 #region Public Methods
43- /// <summary>
44- /// Asserts the value is of the expected type.
45- /// </summary>
46- /// <typeparam name="TValue">The expected type.</typeparam>
47- /// <returns>The typed value.</returns>
48- public TValue ValueAs < TValue > ( )
49- {
50- var value = CreatedResultSubject . Value ;
51-
52- if ( value == null )
53- Execute . Assertion
54- . WithDefaultIdentifier ( "CreatedResult.Value" )
55- . FailWith ( FailureMessages . CommonNullWasSuppliedFailMessage , typeof ( TValue ) ) ;
56-
57- Execute . Assertion
58- . ForCondition ( value is TValue )
59- . WithDefaultIdentifier ( "CreatedResult.Value" )
60- . FailWith ( FailureMessages . CommonTypeFailMessage , typeof ( TValue ) , value . GetType ( ) ) ;
61-
62- return ( TValue ) value ;
63- }
64-
6535 /// <summary>
6636 /// Asserts the uri has the expected value.
6737 /// </summary>
0 commit comments