Esempio n. 1
0
        public void Can_construct_spec_by_listing_subspecs()
        {
            var spec = new ItemSpec(0x1111).Including(new ItemSpec(0x2222), new ItemSpec(0x3333));

            spec.Matches(new Item(new ObjectId(0), 0x1111, 1, new Location3D(0, 0, 0), (Color)0x99, null, null)).Should().BeTrue();
            spec.Matches(new Item(new ObjectId(0), 0x2222, 1, new Location3D(0, 0, 0), (Color)0x99, null, null)).Should().BeTrue();
            spec.Matches(new Item(new ObjectId(0), 0x3333, 1, new Location3D(0, 0, 0), (Color)0x99, null, null)).Should().BeTrue();
        }
Esempio n. 2
0
        public void Matching_when_any_subspecs_has_same_ModelId()
        {
            var spec = new ItemSpec(new ItemSpec(0x1111), new ItemSpec(0x2222));

            spec.Matches(0x1111).Should().BeTrue();
            spec.Matches(0x2222).Should().BeTrue();
            spec.Matches(0x3333).Should().BeFalse();
        }
Esempio n. 3
0
        public void Spec_with_ModelId_and_Color_not_matching_Item_with_different_Color()
        {
            var spec = new ItemSpec(0x4444, (Color)0x22);
            var item = new Item(new ObjectId(0), 0x4444, 1, new Location3D(0, 0, 0), (Color)0x99, null, null);

            spec.Matches(item).Should().BeFalse();
        }
Esempio n. 4
0
        public void Spec_with_ModelId_not_matching_Item_with_other_ModelId()
        {
            var spec = new ItemSpec(0x4444);
            var item = new Item(new ObjectId(0), 0x2222, 1, new Location3D(0, 0, 0), (Color)0, null, null);

            spec.Matches(item).Should().BeFalse();
        }
Esempio n. 5
0
        public void Spec_with_ModelId_matches_Item_with_same_ModelId()
        {
            var spec = new ItemSpec(0x4444);
            var item = new Item(new ObjectId(0), 0x4444, 1, new Location3D(0, 0, 0), null, null, null);

            spec.Matches(item).Should().BeTrue();
        }
Esempio n. 6
0
        public void Spec_with_no_matching_subspecs_Not_Matching_item()
        {
            var spec = new ItemSpec(new ItemSpec(0x1111), new ItemSpec(0x2222));

            var item = new Item(new ObjectId(0), 0x9999, 1, new Location3D(0, 0, 0), (Color)0x99, null, null);

            spec.Matches(item).Should().BeFalse();
        }
Esempio n. 7
0
        public void Spec_with_ModelId_and_Color_doesnt_match_same_ModelId_different_Color()
        {
            var spec = new ItemSpec(0x4444, (Color)0x5555);

            spec.Matches(0x4444).Should().BeFalse();
        }
Esempio n. 8
0
        public void Spec_with_ModelId_doesnt_match_different_ModelId()
        {
            var spec = new ItemSpec(0x4444);

            spec.Matches(0x1111).Should().BeFalse();
        }
Esempio n. 9
0
        public void Spec_with_ModelId_matches_same_ModelId()
        {
            var spec = new ItemSpec(0x4444);

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