Ejemplo n.º 1
0
        public void SetName()
        {
            var label = new ShipLabel.Name(Point.Empty, ShipNameWidth.AkashiTimer)
            {
                Parent = new Panel()
            };

            Scaler.Factor = new SizeF(1, 1);
            label.Set(new ShipStatus
            {
                Spec = new ShipSpec {
                    Name = "綾波改二"
                },
                Escaped = true
            });
            PAssert.That(() => label.Text == "[避]綾波改二");
            label.Set(new ShipStatus
            {
                Spec = new ShipSpec {
                    Name = "朝潮改二丁"
                },
                Escaped = true
            });
            PAssert.That(() => label.Text == "[避]朝潮改二");
        }
Ejemplo n.º 2
0
            public void Unlimited()
            {
                var label = new ShipLabel.Name(Point.Empty, ShipNameWidth.Max)
                {
                    Parent = new Panel()
                };
                var str = "一二三四五六七八九〇一二三四五六七八九〇一二三四五六七八九〇";

                label.SetName(str);
                Assert.AreEqual(str, label.Text);
            }
Ejemplo n.º 3
0
 private static void TestTruncate(TestData data, ShipNameWidth width)
 {
     foreach (var zoom in data.Keys)
     {
         SetScaleFactor(zoom);
         var label = new ShipLabel.Name(Point.Empty, width)
         {
             Font = ShipLabel.Name.BaseFont
         };
         for (var i = 0; i < data[zoom].Length; i++)
         {
             var entry = data[zoom][i];
             if (string.IsNullOrEmpty(entry.Origin))
             {
                 entry = data[100][i];
             }
             label.SetName(entry.Origin);
             Assert.AreEqual(entry.Result, label.Text, $"{entry.Origin}: scale {zoom}");
         }
     }
 }