Пример #1
0
        public void Not_be_different_when_values_are_equal()
        {
            var id1A = new ScsId("12354321");
            var id2A = new ScsId("12354321");

            Check.That(id1A != id2A).IsFalse();
        }
Пример #2
0
        public void Not_be_equal_when_member_is_null()
        {
            var   id1A = new ScsId("12345678");
            ScsId id2A = null;

            Check.That(id1A.Equals(id2A)).IsFalse();
        }
Пример #3
0
        public void Not_be_equal_when_values_are_different()
        {
            var id1A = new ScsId("12345678");
            var id2A = new ScsId("65498123");

            Check.That(id1A != id2A).IsTrue();
        }
Пример #4
0
 public void Throw_exception_when_value_passed_to_constructor_is_invalid()
 {
     Check.ThatCode(() =>
     {
         var x = new ScsId("bad-id");
     }).Throws <ArgumentException>();
 }
Пример #5
0
        public void Not_be_equal_when_members_are_not_equal()
        {
            var id1A = new ScsId("12345678");
            var id2A = new ScsId("12354321");

            Check.That(id1A.Equals(id2A)).IsFalse();
        }
Пример #6
0
        public void Not_be_equal_when_null_values()
        {
            var   id1A = new ScsId("12345678");
            ScsId id2A = null;

            Check.That(id1A == id2A).IsFalse();
            Check.That(id2A == id1A).IsFalse();
        }
Пример #7
0
        public void Return_value_hash_code()
        {
            var id1A = new ScsId("12345678");
            var id2A = new ScsId("12365498");

            Check.That(id1A.GetHashCode()).IsEqualTo("12345678".GetHashCode());
            Check.That(id2A.GetHashCode()).IsEqualTo("12365498".GetHashCode());
        }
Пример #8
0
        public void Be_equal_when_members_are_equal()
        {
            var id1A = new ScsId("12345678");
            var id2A = new ScsId("12345678");

            Check.That(id1A.Equals(id2A)).IsTrue();
            Check.That(id1A).Equals(id2A);
        }
Пример #9
0
        public void Be_different_when_1_null_value()
        {
            var   id1A = new ScsId("12345678");
            ScsId id2A = null;

            Check.That(id1A != id2A).IsTrue();
            Check.That(id2A != id1A).IsTrue();
        }
Пример #10
0
        public void Add_and_retrieve_a_SCS_device()
        {
            var sn        = new SystemName("Command5");
            var id        = new ScsId("12345678");
            var units     = new Unit[0];
            var scsDevice = new PctClassLibrary.SCS.Device(sn, id, units);

            _rcuController.AddDevice(scsDevice);

            Check.That(_rcuController.GetDevices4Technology(Definition.TechnologyType.SCS).Devices[0]).IsInstanceOf <PctClassLibrary.SCS.Device>();
            Check.That(_rcuController.GetDevices4Technology(Definition.TechnologyType.SCS).Devices[0].SystemName.Value).IsEqualTo("Command5");
            Check.That(((PctClassLibrary.SCS.Device)_rcuController.GetDevices4Technology(Definition.TechnologyType.SCS).Devices[0]).BusId).Equals(id);
            Check.That(((PctClassLibrary.SCS.Device)_rcuController.GetDevices4Technology(Definition.TechnologyType.SCS).Devices[0]).BusId.Value).IsEqualTo("12345678");
        }
Пример #11
0
 public void Not_be_valid_when_a_invalid_value_is_passed()
 {
     Check.That(ScsId.IsValid("bad-id")).IsFalse();
 }
Пример #12
0
 public void Be_valid_when_a_valid_value_is_passed()
 {
     Check.That(ScsId.IsValid("12345678")).IsTrue();
 }
Пример #13
0
        public void Create_an_instance_with_value_passed_in_constructor()
        {
            var deviceId = new ScsId("12345678");

            Check.That(deviceId.Value).Equals("12345678");
        }
Пример #14
0
 public void Return_invalid_scs_ids_for_all_values(string id)
 {
     Check.That(ScsId.IsValid(id)).IsFalse();
 }
Пример #15
0
        public void Be_of_ScsId_type_when_created()
        {
            var id = new ScsId("12345678");

            Check.That(id).IsInstanceOf <ScsId>();
        }