Exemple #1
0
        public void WhenReadCsvFile_ResultMustContainTag()
        {
            var tags = _testee.ImportTags(It.IsAny <string>());

            tags.Should().Contain(c =>
                                  c.Type == TagType.Tag &&
                                  c.Scope.Equals(string.Empty) &&
                                  c.Name.Equals("DistributedEthernetIO:1:C"),
                                  "it is defined in simulated csv test data");
        }
        public void SimpleTagImporterTest()
        {
            IReadOnlyCollection <Tag> importedTags = _tagImporter.ImportTags("MiddlePRG_1.fbAGS_1");

            var listener = new BeckhoffPollingTagListener(Global.AdsAddress, Global.AdsPort, new GlobalLock(), _logger);

            foreach (var importedTag in importedTags)
            {
                listener.AddTagsRecursively(importedTag);
            }
            listener.RefreshAll();

            var tag = new Tag("fbAGS_1.SIf.In.bolAddTestAlarm", "MiddlePRG_1", Global.AdsPort);

            listener.GetTags().Should().ContainSingle(t => t == tag);
        }
        public void WhenWrongPath_ShouldThrowTagReaderException()
        {
            Action action = () => _importedTagList = _testee.ImportTags("invalid_file_does_not_exist_test.xml", port: 0);

            action.ShouldThrow <TagReaderException>().WithInnerException <FileNotFoundException>();
        }
 public void Setup()
 {
     _testee          = new BeckhoffXmlTagImporter();
     _importedTagList = _testee.ImportTags("GlobalVariables_TestExportFile.xml", port: 0);
 }
 public void Setup()
 {
     _testee          = new BeckhoffXmlTagImporter();
     _importedTagList = _testee.ImportTags("ForcingLayer_TestExportFile.xml", port: 0);
 }