Inheritance: Aqueduct.Monitoring.Sensors.SensorBase
        public void AddReading_WhenReadingDataNameNotSet_UsesTheSensorReadingName()
        {
            var sensor = new SensorTestDouble("test");

            sensor.Add(new Int32ReadingData(1));

            Assert.That(ReadingPublisher.Readings.First().Data.Name, Is.EqualTo("test"));
        }
        public void GetFeatureName_WithFeatureName_SetsFeatureNameForAllReadingsAdded()
        {
            string featureName = "Feature1";

            var sensor = new SensorTestDouble("readingName") { FeatureName = featureName };

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo(featureName));
        }
        public void AddReading_WhenReadingDataNameNotSet_UsesTheSensorReadingName()
        {
            var sensor = new SensorTestDouble("test");

            sensor.Add(new Int32ReadingData(1));

            Assert.That(ReadingPublisher.Readings.First().Data.Name, Is.EqualTo("test"));
        }
        public void SetThreadScopedFeatureName_WithoutFeatureGroupSpecified_SetsFeatureGroupToGlobal()
        {
            SensorBase.SetThreadScopedFeatureName("test");

            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Group, Is.EqualTo(FeatureStatistics.GlobalGroupName));
        }
        public void GetFeatureGroup_WithoutOneSpecified_SetsGroupToGlobal()
        {
            var sensor = new SensorTestDouble("test") { FeatureName = "featureName" };

            sensor.Add(new Int32ReadingData(1));

            Assert.That(ReadingPublisher.Readings.First().FeatureGroup, Is.EqualTo(FeatureStatistics.GlobalGroupName));
        }
        public void GetFeatureName_WhenFeatureNameIsInThreadContext_ReturnsTheOneFromTheThreadContext()
        {
            string featureName = "datapointName";
			SensorBase.SetThreadScopedFeatureName(featureName);

            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo(featureName));
        }
        public void GetFeatureName_WhenFeatureNameIsInThreadContext_ReturnsTheOneFromTheThreadContext()
        {
            string featureName = "datapointName";

            SensorBase.SetThreadScopedFeatureName(featureName);

            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo(featureName));
        }
        public void AddReading_WhenReadingDateNameIsSet_UsesTheReadingDataNameInsteadOfSensorReadingName()
        {
            string readingDataName = "ReadingDataName";
            string sensorReadingName = "SenorReadingName";
            var sensor = new SensorTestDouble(sensorReadingName);

            sensor.Add(new Int32ReadingData(1) { Name = readingDataName });

            Assert.That(ReadingPublisher.Readings.First().Data.Name, Is.EqualTo(readingDataName));
        }
        public void ClearThreadScoredFeatureName_AfterSettingFeatureNameToTest_ReturnsApplication()
        {
            string featureName = "datapointName";
            SensorBase.SetThreadScopedFeatureName(featureName);

            var sensor = new SensorTestDouble("test");
            SensorBase.ClearThreadScopedFeatureName();

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo("Application"));
        }
Exemplo n.º 10
0
        public void SetThreadScopeFeatureName_WithFeatureGroupSpecified_SetsFeatureGroupAccordingly()
        {
            string testGroup = "testGroup";

            SensorBase.SetThreadScopedFeatureName("test", testGroup);

            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Group, Is.EqualTo(testGroup));
        }
Exemplo n.º 11
0
        public void GetFeatureName_WithFeatureName_SetsFeatureNameForAllReadingsAdded()
        {
            string featureName = "Feature1";

            var sensor = new SensorTestDouble("readingName")
            {
                FeatureName = featureName
            };

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo(featureName));
        }
Exemplo n.º 12
0
        public void GetFeatureGroup_WithoutOneSpecified_SetsGroupToGlobal()
        {
            var sensor = new SensorTestDouble("test")
            {
                FeatureName = "featureName"
            };

            sensor.Add(new Int32ReadingData(1));

            Assert.That(ReadingPublisher.Readings.First().FeatureGroup, Is.EqualTo(FeatureStatistics.GlobalGroupName));
        }
Exemplo n.º 13
0
        public void SetThreadScopeFeatureName_WhenFeatureGroupIsSetBothInSensorAndInThreadContext_TheSensorValueIsUsed()
        {
            SensorBase.SetThreadScopedFeatureName("test", "threadScopedGroup");

            string sensorGroup = "SensorGroup";
            var    sensor      = new SensorTestDouble("test")
            {
                FeatureName = "Name", FeatureGroup = sensorGroup
            };

            Assert.That(sensor.GetFeatureNameExposed().Group, Is.EqualTo(sensorGroup));
        }
Exemplo n.º 14
0
        public void GetFeatureGroup_WithOneSet_SetsCorrectGroupToReading()
        {
            string group  = "featureGroup";
            var    sensor = new SensorTestDouble("test")
            {
                FeatureName = "featureName", FeatureGroup = group
            };

            sensor.Add(new Int32ReadingData(1));

            Assert.That(ReadingPublisher.Readings.First().FeatureGroup, Is.EqualTo(group));
        }
Exemplo n.º 15
0
        public void ClearThreadScoredFeatureName_AfterSettingFeatureNameToTest_ReturnsApplication()
        {
            string featureName = "datapointName";

            SensorBase.SetThreadScopedFeatureName(featureName);

            var sensor = new SensorTestDouble("test");

            SensorBase.ClearThreadScopedFeatureName();

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo("Application"));
        }
Exemplo n.º 16
0
        public void AddReading_WhenReadingDateNameIsSet_UsesTheReadingDataNameInsteadOfSensorReadingName()
        {
            string readingDataName   = "ReadingDataName";
            string sensorReadingName = "SenorReadingName";
            var    sensor            = new SensorTestDouble(sensorReadingName);

            sensor.Add(new Int32ReadingData(1)
            {
                Name = readingDataName
            });

            Assert.That(ReadingPublisher.Readings.First().Data.Name, Is.EqualTo(readingDataName));
        }
Exemplo n.º 17
0
        public void SetThreadScopeFeatureName_WithFeatureGroupSpecified_AddReadingWithCorrectGroupName()
        {
            string testGroup = "testGroup";

            SensorBase.SetThreadScopedFeatureName("test", testGroup);

            var sensor = new SensorTestDouble("test");

            sensor.Add(new Int32ReadingData(1));
            Reading reading = null;

            ReadingPublisher.Readings.TryDequeue(out reading);

            Assert.That(reading.FeatureGroup, Is.EqualTo(testGroup));
        }
Exemplo n.º 18
0
        public void AddReading_WhenNoDataPointNameAvailable_SetsReadingNameTo_Application()
        {
            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo("Application"));
        }
Exemplo n.º 19
0
        public void AddReading_WhenNoDataPointNameAvailable_SetsReadingNameTo_Application()
        {
            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Name, Is.EqualTo("Application"));
        }
Exemplo n.º 20
0
        public void SetThreadScopeFeatureName_WithFeatureGroupSpecified_AddReadingWithCorrectGroupName()
        {
            string testGroup = "testGroup";
            SensorBase.SetThreadScopedFeatureName("test", testGroup);

            var sensor = new SensorTestDouble("test");
            sensor.Add(new Int32ReadingData(1));
            Reading reading = null;
            ReadingPublisher.Readings.TryDequeue(out reading);

            Assert.That(reading.FeatureGroup, Is.EqualTo(testGroup));
        }
Exemplo n.º 21
0
        public void SetThreadScopeFeatureName_WithFeatureGroupSpecified_SetsFeatureGroupAccordingly()
        {
            string testGroup = "testGroup";
            SensorBase.SetThreadScopedFeatureName("test", testGroup);

            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Group, Is.EqualTo(testGroup));
        }
Exemplo n.º 22
0
        public void SetThreadScopeFeatureName_WhenFeatureGroupIsSetBothInSensorAndInThreadContext_TheSensorValueIsUsed()
        {
            SensorBase.SetThreadScopedFeatureName("test", "threadScopedGroup");

            string sensorGroup = "SensorGroup";
            var sensor = new SensorTestDouble("test") { FeatureName = "Name", FeatureGroup = sensorGroup };

            Assert.That(sensor.GetFeatureNameExposed().Group, Is.EqualTo(sensorGroup));
        }
Exemplo n.º 23
0
        public void GetFeatureGroup_WithOneSet_SetsCorrectGroupToReading()
        {
            string group = "featureGroup";
            var sensor = new SensorTestDouble("test") { FeatureName = "featureName", FeatureGroup = group };

            sensor.Add(new Int32ReadingData(1));

            Assert.That(ReadingPublisher.Readings.First().FeatureGroup, Is.EqualTo(group));
        }
Exemplo n.º 24
0
        public void SetThreadScopedFeatureName_WithoutFeatureGroupSpecified_SetsFeatureGroupToGlobal()
        {
            SensorBase.SetThreadScopedFeatureName("test");

            var sensor = new SensorTestDouble("test");

            Assert.That(sensor.GetFeatureNameExposed().Group, Is.EqualTo(FeatureStatistics.GlobalGroupName));
        }
Exemplo n.º 25
0
 public void Initialise()
 {
     FeatureName = new SensorTestDouble("test").GetFeatureNameExposed().Name;
     //some initialisation code is happending here
     Calucalte();
 }