Class RecordingScoreService
IScoreService implementation backed by an in-memory dictionary, recording how
often each mutation was called so a test can assert both the resulting value and the fact
that the service was (or was not) touched at all.
Inheritance
RecordingScoreService
Assembly: Tests.dll
Syntax
public class RecordingScoreService : IScoreService, IService, IFoundationSettings
Constructors
RecordingScoreService()
Declaration
public RecordingScoreService()
Properties
AddCallCount
Declaration
public int AddCallCount { get; }
Property Value
Guid
Declaration
public string Guid { get; set; }
Property Value
Id
Declaration
public string Id { get; set; }
Property Value
LogService
Declaration
public ILogService LogService { get; set; }
Property Value
RegisterCallCount
Declaration
public int RegisterCallCount { get; }
Property Value
TryGetValueCallCount
Declaration
public int TryGetValueCallCount { get; }
Property Value
Methods
Add(ScoreKey, float)
Declaration
public void Add(ScoreKey key, float delta)
Parameters
AmountOf(string)
The current amount stored under a metric key, or zero when it is not registered.
Declaration
public float AmountOf(string key)
Parameters
| Type |
Name |
Description |
| string |
key |
The metric key to read.
|
Returns
Divide(ScoreKey, float)
Declaration
public void Divide(ScoreKey key, float divisor)
Parameters
GetSnapshot()
Declaration
public ScoreSnapshot GetSnapshot()
Returns
Multiply(ScoreKey, float)
Declaration
public void Multiply(ScoreKey key, float factor)
Parameters
Register(ScoreKey, ScoreMetricKind)
Declaration
public void Register(ScoreKey key, ScoreMetricKind kind)
Parameters
ResetAll()
Declaration
ResetKey(ScoreKey)
Declaration
public void ResetKey(ScoreKey key)
Parameters
SaveSnapshot()
Declaration
public bool SaveSnapshot()
Returns
Set(ScoreKey, float)
Declaration
public void Set(ScoreKey key, float value)
Parameters
Subtract(ScoreKey, float)
Declaration
public void Subtract(ScoreKey key, float delta)
Parameters
TryGetValue(ScoreKey, out ScoreValue)
Declaration
public bool TryGetValue(ScoreKey key, out ScoreValue value)
Parameters
Returns
Implements