-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathIViewBagTestBuilder.cs
More file actions
85 lines (74 loc) · 4.07 KB
/
IViewBagTestBuilder.cs
File metadata and controls
85 lines (74 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
namespace MyTested.AspNetCore.Mvc.Builders.Contracts.Data
{
using System;
using System.Collections.Generic;
/// <summary>
/// Used for testing dynamic view bag.
/// </summary>
public interface IViewBagTestBuilder
{
/// <summary>
/// Tests whether the dynamic view bag contains entry with the provided key.
/// </summary>
/// <param name="key">Key of the view bag entry.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntryWithKey(string key);
/// <summary>
/// Tests whether the dynamic view bag contains entry with the provided value.
/// </summary>
/// <typeparam name="TValue">Type of the view bag entry value.</typeparam>
/// <param name="value">Value of the view bag entry.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntryWithValue<TValue>(TValue value);
/// <summary>
/// Tests whether the dynamic view bag contains entry with value of the provided type.
/// </summary>
/// <typeparam name="TValue">Type of the view bag entry value.</typeparam>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntryOfType<TValue>();
/// <summary>
/// Tests whether the dynamic view bag contains entry with value of the provided type and the given key.
/// </summary>
/// <typeparam name="TValue">Type of the view bag entry value.</typeparam>
/// <param name="key">Key of the view bag entry.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntryOfType<TValue>(string key);
/// <summary>
/// Tests whether the dynamic view bag contains entry with the provided key and corresponding value.
/// </summary>
/// <param name="key">Key of the view bag entry.</param>
/// <param name="value">Value of the view bag entry.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntry(string key, object value);
/// <summary>
/// Tests whether the dynamic view bag contains specific entry by using a builder.
/// </summary>
/// <param name="viewBagEntryTestBuilder">Builder for setting specific dynamic view bag entry tests.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntry(Action<IDataProviderEntryKeyTestBuilder> viewBagEntryTestBuilder);
/// <summary>
/// Tests whether the dynamic view bag contains the provided entries.
/// </summary>
/// <param name="entries">Anonymous object of view bag entries.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntries(object entries);
/// <summary>
/// Tests whether the dynamic view bag contains the provided entries.
/// </summary>
/// <param name="entries">Dictionary of view bag entries.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder ContainingEntries(IDictionary<string, object> entries);
/// <summary>
/// Tests whether the view bag entry passes the given assertions.
/// </summary>
/// <param name="assertions">Action containing all assertions for the view bag entry.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder Passing(Action assertions);
/// <summary>
/// Tests whether the view bag entry passes the given predicate.
/// </summary>
/// <param name="predicate">Predicate testing the view bag entry.</param>
/// <returns>The same <see cref="IAndViewBagTestBuilder"/>.</returns>
IAndViewBagTestBuilder Passing(Func< bool> predicate);
}
}