Пример #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);
        }
Пример #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);
        }
Пример #3
0
        public void DisplayName()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            TaggerController.DisplayName.ShouldNotBeNullOrEmpty();
            TaggerController.DisplayName.ShouldNotBeNullOrWhiteSpace();
            TaggerController.DisplayName.ShouldBe("Tagger");
        }
Пример #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);
        }
Пример #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);
        }
Пример #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();
        }
Пример #7
0
 public void Constructor()
 {
     TaggerController taggerController = this.Container.GetInstance <TaggerController>();
 }
Пример #8
0
        public void Close()
        {
            TaggerController taggerController = this.Container.GetInstance <TaggerController>();

            taggerController.Close();
        }
Пример #9
0
        public TaggerView(TaggerController taggerController)
        {
            this.InitializeComponent();

            this.taggerController = taggerController;
        }