コード例 #1
0
        public void TestDaytimerEntryParse()
        {
            var demoData = Automatica.Core.Driver.Utility.Utils.StringToByteArray("00000000770100002805000000000000000000000000F03F");

            var entry = DaytimerEntry.Parse(demoData);

            Assert.NotNull(entry);

            Assert.Equal(375, entry.From);
            Assert.Equal(0, entry.Mode);
            Assert.Equal(0, entry.NeedActivate);
            Assert.Equal(1320, entry.To);
            Assert.Equal(1, entry.Value);
        }
コード例 #2
0
        public void TestDaytimerEntryParseFail2()
        {
            var demoData = Automatica.Core.Driver.Utility.Utils.StringToByteArray("770100002805000000000000000000000000F03F");

            Assert.Throws <ArgumentException>(() => DaytimerEntry.Parse(demoData));
        }