Exemple #1
0
        public void Can_construct_spec_by_listing_subspecs()
        {
            var spec = new MobileSpec(0x1111).Including(new MobileSpec(0x2222), new MobileSpec(0x3333));

            spec.Matches(new Mobile(new ObjectId(0), 0x1111, new Location3D(0, 0, 0), (Color)0x99, null, null, null)).Should().BeTrue();
            spec.Matches(new Mobile(new ObjectId(0), 0x2222, new Location3D(0, 0, 0), (Color)0x99, null, null, null)).Should().BeTrue();
            spec.Matches(new Mobile(new ObjectId(0), 0x3333, new Location3D(0, 0, 0), (Color)0x99, null, null, null)).Should().BeTrue();
        }
Exemple #2
0
        public void Matching_when_any_subspecs_has_same_ModelId()
        {
            var spec = new MobileSpec(new MobileSpec(0x1111), new MobileSpec(0x2222));

            spec.Matches(0x1111).Should().BeTrue();
            spec.Matches(0x2222).Should().BeTrue();
            spec.Matches(0x3333).Should().BeFalse();
        }
Exemple #3
0
        public void Spec_with_ModelId_and_Color_not_matching_Item_with_different_Color()
        {
            var spec   = new MobileSpec(0x4444, (Color)0x22);
            var mobile = new Mobile(new ObjectId(0), 0x4444, new Location3D(0, 0, 0), (Color)0x99, null, null, null);

            spec.Matches(mobile).Should().BeFalse();
        }
Exemple #4
0
        public void Spec_with_ModelId_not_matching_Item_with_other_ModelId()
        {
            var spec   = new MobileSpec(0x4444);
            var mobile = new Mobile(new ObjectId(0), 0x2222, new Location3D(0, 0, 0), (Color)0, null, null, null);

            spec.Matches(mobile).Should().BeFalse();
        }
Exemple #5
0
        public void Spec_with_ModelId_matches_Mobile_with_same_ModelId()
        {
            var spec   = new MobileSpec(0x4444);
            var mobile = new Mobile(new ObjectId(0), 0x4444, new Location3D(0, 0, 0));

            spec.Matches(mobile).Should().BeTrue();
        }
Exemple #6
0
        public void Spec_with_no_matching_subspecs_Not_Matching_mobile()
        {
            var spec = new MobileSpec(new MobileSpec(0x1111), new MobileSpec(0x2222));

            var mobile = new Mobile(new ObjectId(0), 0x9999, new Location3D(0, 0, 0), (Color)0x99, null, null, null);

            spec.Matches(mobile).Should().BeFalse();
        }
Exemple #7
0
        public void Speci_with_Name_matches_Mobile_with_same_Name()
        {
            var spec   = new MobileSpec("TestName");
            var mobile = new Mobile(new ObjectId(0), 0x4444, new Location3D(0, 0, 0));

            mobile = (Mobile)mobile.UpdateName("TestName");

            spec.Matches(mobile).Should().BeTrue();
        }
Exemple #8
0
        public void Spec_with_ModelId_and_Color_doesnt_match_same_ModelId()
        {
            var spec = new MobileSpec(0x4444, (Color)0x5555);

            spec.Matches(0x4444).Should().BeFalse();
        }
Exemple #9
0
        public void Spec_with_ModelId_doesnt_match_different_ModelId()
        {
            var spec = new MobileSpec(0x4444);

            spec.Matches(0x1111).Should().BeFalse();
        }
Exemple #10
0
        public void Spec_with_ModelId_matches_same_ModelId()
        {
            var spec = new MobileSpec(0x4444);

            spec.Matches(0x4444).Should().BeTrue();
        }