public void Setup()
 {
     _id          = Guid.NewGuid();
     _arraySource = SomeModel
                    .Generate(200)
                    .Append(SomeModel.FromId(_id))
                    .ToArray();
     _listSource = SomeModel
                   .Generate(200)
                   .Append(SomeModel.FromId(_id))
                   .ToList();
     _collectionSource = new Collection <SomeModel>(
         SomeModel
         .Generate(200)
         .Append(SomeModel.FromId(_id))
         .ToList());
     _hashSetSource = SomeModel
                      .Generate(200)
                      .Append(SomeModel.FromId(_id))
                      .ToHashSet(new SomeModel.IdEqualityComparer());
     _dictionarySource = SomeModel
                         .Generate(200)
                         .Append(SomeModel.FromId(_id))
                         .ToDictionary(m => m.Id);
 }
 private static SomeModel ModifyImmutably(SomeModel model) =>
 new SomeModel
 {
     Id    = model.Id,
     Name  = model.Name + ": modified",
     Value = model.Value * 2,
     When  = model.When.AddDays(1)
 };
 public void Setup()
 {
     _id     = Guid.NewGuid();
     _source = SomeModel
               .Generate(200)
               .Append(SomeModel.FromId(_id))
               .ToDictionary(m => m.Id);
 }
 private static bool ValueHalfFull(SomeModel model) =>
 model.Value <= 50;
Beispiel #5
0
 private static bool ValueHalfEmpty(SomeModel model) =>
 model.Value <= 50;
Beispiel #6
0
 public void Setup()
 {
     _source = SomeModel
               .Generate(200000)
               .ToDictionary(m => m.Id);
 }
 private static bool ValueHalfFull(SomeModel arg) =>
 arg.Value <= 50;