public void Test_Builder_Inits_To_Zero_With_WithStat(int value) { //arrange var builder = ImmutableStatsContainerBuilder <TStatType> .Factory.Create(); ImmutableStatsContainer <TStatType> container = null; //act foreach (TStatType statType in Enum.GetValues(typeof(TStatType))) { builder.WithStat(statType, value); } container = BuildForGeneric(builder); foreach (TStatType statType in Enum.GetValues(typeof(TStatType))) { //assert: That all values are present and zero IStatProvider <TStatType> provider = container[statType]; Assert.NotNull(provider); Assert.AreEqual(value, provider.Value); } }
public void Test_Builder_Inits_To_Zero_With_Defaults() { //arrange ImmutableStatsContainer <TStatType> container = BuildForGeneric(ImmutableStatsContainerBuilder <TStatType> .Factory.Create().WithDefaults()); foreach (TStatType statType in Enum.GetValues(typeof(TStatType))) { //assert: That all values are present and zero IStatProvider <TStatType> provider = container[statType]; Assert.NotNull(provider); Assert.AreEqual(0, provider.Value); } }