Exemplo n.º 1
0
    /// <summary>
    /// Prevents a default instance of the <see cref="Manager"/> class from being created.
    /// </summary>
    private Manager()
    {
        const int n = 5000;

        Array = new IArrayItem[n];
        for (int i = 0; i < n; i++)
        {
            Array[i] = new ArrayItem();
        }
    }
Exemplo n.º 2
0
        public async Task TestArraySerialization(NextApiTransport transport)
        {
            var service = App.ResolveService <ITestService>(null, transport);
            // we are going to test array serialization. sounds very simple,
            // but there were some problem with sub-type detecting in JSON Serializer...
            var source = new IArrayItem[]
            {
                new EquipmentArrayItem {
                    Id = "Dfdfsdfsf", EquipmentName = "lolkeks"
                },
                new EquipmentArrayItem {
                    Id = "Dfdfsdfsf333", EquipmentName = "lolkeks555"
                },
                new WorkArrayItem {
                    Id = "Dfdfsdfsf", WorkName = "lolkeksfdsfsfsd"
                },
                new WorkArrayItem {
                    Id = "Dfdfsdfsf3432432re", WorkName = "lolkeksfdsfsfsddfsdfsfserere"
                }
            };
            var returned = await service.TestArraySerializationDeserialization(source);

            source.ShouldDeepEqual(returned);
        }