Exemplo n.º 1
0
        public void SelectPixel()
        {
            IImageSource     imageSource      = this.Container.GetInstance <IImageSource>();
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.GetPoints(LabelName).Count.ShouldBe(0);

            taggerController.SelectPixel(null, Point.Empty);

            taggerController.GetPoints(LabelName).Count.ShouldBe(0);

            taggerController.AddLabel(LabelName);

            taggerController.SelectPixel(null, Point.Empty);

            taggerController.GetPoints(LabelName).Count.ShouldBe(0);

            taggerController.SelectLabel(LabelName);

            taggerController.SelectPixel(imageSource, new Point(42, 54));

            taggerController.GetPoints(LabelName).Count.ShouldBe(1);

            taggerController.GetPoints(LabelName)[0].X.ShouldBe(42);
            taggerController.GetPoints(LabelName)[0].Y.ShouldBe(54);
        }
Exemplo n.º 2
0
        public void RemovePoint()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.RemovePoint(string.Empty, new Point(1, 1));

            taggerController.AddLabel(LabelName);

            taggerController.GetPoints(LabelName).Count.ShouldBe(0);

            taggerController.RemovePoint(LabelName, new Point(1, 1));

            taggerController.AddPoint(LabelName, new Point(42, 54));

            taggerController.GetPoints(LabelName).Count.ShouldBe(1);

            taggerController.GetPoints(LabelName)[0].X.ShouldBe(42);
            taggerController.GetPoints(LabelName)[0].Y.ShouldBe(54);

            taggerController.RemovePoint(LabelName, new Point(1, 1));

            taggerController.GetPoints(LabelName).Count.ShouldBe(1);

            taggerController.RemovePoint(LabelName, new Point(42, 54));

            taggerController.GetPoints(LabelName).Count.ShouldBe(0);
        }
Exemplo n.º 3
0
        public void DisplayName()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            TaggerController.DisplayName.ShouldNotBeNullOrEmpty();
            TaggerController.DisplayName.ShouldNotBeNullOrWhiteSpace();
            TaggerController.DisplayName.ShouldBe("Tagger");
        }
Exemplo n.º 4
0
        public void AddLabel()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.Labels.Count().ShouldBe(0);

            taggerController.AddLabel(LabelName);

            taggerController.Labels.Count().ShouldBe(1);
            taggerController.Labels.First().ShouldBe(LabelName);
        }
Exemplo n.º 5
0
        public void AddPoint()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.GetPoints(LabelName).Count.ShouldBe(0);

            taggerController.AddPoint(LabelName, new Point(42, 54));

            taggerController.GetPoints(LabelName).Count.ShouldBe(1);

            taggerController.GetPoints(LabelName)[0].X.ShouldBe(42);
            taggerController.GetPoints(LabelName)[0].Y.ShouldBe(54);
        }
Exemplo n.º 6
0
        public void SelectLabel()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.SelectedLabel.ShouldBeNull();

            // Cannot select label which has not been added yet
            Assert.Throws <Shouldly.ShouldAssertException>(() => { taggerController.SelectLabel(LabelName); });

            taggerController.AddLabel(LabelName);

            taggerController.SelectLabel(LabelName);

            taggerController.SelectedLabel.ShouldBe(LabelName);

            taggerController.SelectLabel(null);

            taggerController.SelectedLabel.ShouldBeNull();
        }
Exemplo n.º 7
0
 public void Constructor()
 {
     TaggerController taggerController = this.Container.GetInstance <TaggerController>();
 }
Exemplo n.º 8
0
        public void Close()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.Close();
        }
Exemplo n.º 9
0
        public TaggerView(TaggerController taggerController)
        {
            this.InitializeComponent();

            this.taggerController = taggerController;
        }