コード例 #1
0
        public void Setup()
        {
            var modelB = new ModelB
            {
                Id         = 1,
                Name       = "Foo Bar ModelB",
                CreateDate = DateTime.Now
            };

            _modelA = new ModelA
            {
                ModelBValue = modelB,
                MapValue    = new Dictionary <string, ModelB>
                {
                    ["1"] = modelB
                },
                ModelBListValue = Enumerable.Range(1, 100).Select(x => new ModelB
                {
                    Id         = x,
                    Name       = $"Foo Bar {x}",
                    CreateDate = DateTime.Now
                }).ToList(),
                ArrayIntValue   = Enumerable.Range(1, 1000).ToArray(),
                ListStringValue = Enumerable.Range(1, 100).Select(x => x.ToString()).ToList()
            };

            _products = Product.GetProducts();
        }
コード例 #2
0
 private void Assert(ModelA result)
 {
     Contract.Assert(result != _modelA);
     Contract.Assert(result.IntValue == _modelA.IntValue);
     Contract.Assert(result.StringValue == _modelA.StringValue);
 }