示例#1
0
        public void Returns_by_value_type()
        {
            DISetup.SetupContainer();
            var defs = new List <IDefinition>();

            for (int i = 0; i < 10; i++)
            {
                defs.Add(new Definition()
                {
                    Code         = i.ToString(),
                    ContentSHA   = i.ToString(),
                    Dependencies = new List <string> {
                        i.ToString()
                    },
                    File      = i < 5 ? "file" : i.ToString(),
                    Id        = i.ToString(),
                    ModName   = i.ToString(),
                    Type      = i.ToString(),
                    ValueType = ValueType.Object
                });
            }
            var service = new IndexedDefinitions();

            service.InitMap(defs);
            var results = service.GetByValueType(ValueType.Object);

            results.Count().Should().Be(10);
        }