Exemple #1
0
        public void MergeTest()
        {
            var mergeManager = new MergeManager();
            var _0_0         = new PointInt(0, 0);
            var _0_1         = new PointInt(0, 1);
            var _1_1         = new PointInt(1, 1);
            var m            = 0.1;

            var drops = new Dictionary <WaterDrop, PointInt> {
                { new WaterDrop(m), _0_0 },
                { new WaterDrop(m), _0_0 },
                { new WaterDrop(m, new Vector(0, 1)), _0_1 },
                { new WaterDrop(m, new Vector(0, -1)), _0_1 },
                { new WaterDrop(m, new Vector(0, 1)), _1_1 },
                { new WaterDrop(m, new Vector(1, 0)), _1_1 }
            };

            var newDrops = mergeManager.Merge(_map, drops);

            Assert.Equal(3, newDrops.Count);
        }
        public IActionResult Partition()
        {
            foreach (var file in Request.Form.Files)
            {
                if (file.Length == 0)
                {
                    throw new ArgumentException();
                }

                string v_Path = $"Tmp{Path.DirectorySeparatorChar}{file.FileName}";

                using (var flux = new FileStream(v_Path, FileMode.Create, FileAccess.Write))
                {
                    file.CopyTo(flux);
                }

                MergeManager v_Manager = new MergeManager();
                v_Manager.Merge(v_Path);
            }

            return(Ok());
        }