1
- using System ;
2
- using System . Diagnostics ;
3
- using FluentAssertions . Execution ;
4
- using FluentAssertions . Primitives ;
1
+ using FluentAssertions . Execution ;
5
2
using Microsoft . AspNetCore . Mvc ;
3
+ using System ;
4
+ using System . Diagnostics ;
6
5
7
6
namespace FluentAssertions . AspNetCore . Mvc
8
7
{
9
8
/// <summary>
10
9
/// Contains a number of methods to assert that a <see cref="CreatedResult"/> is in the expected state.
11
10
/// </summary>
12
11
[ DebuggerNonUserCode ]
13
- public class CreatedResultAssertions : ObjectAssertions
12
+ public class CreatedResultAssertions : ObjectResultAssertionsBase < CreatedResult , CreatedResultAssertions >
14
13
{
15
14
#region Public Constructors
16
15
@@ -26,42 +25,13 @@ public CreatedResultAssertions(CreatedResult subject) : base(subject)
26
25
27
26
#region Public Properties
28
27
/// <summary>
29
- /// The value on the CreatedResult
28
+ /// The location on the CreatedResult.
30
29
/// </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 ;
39
31
40
32
#endregion
41
33
42
34
#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
-
65
35
/// <summary>
66
36
/// Asserts the uri has the expected value.
67
37
/// </summary>
0 commit comments