コード例 #1
0
        public void AttributeGetAllTest()
        {
            FeatureService service = getService();
            Feature        feature = new Feature();

            feature.Type = FeatureTypes.STRING;
            feature.Name = "Color";
            service.Add(feature);

            Feature feature2 = new Feature();

            feature2.Type = FeatureTypes.STRING;
            feature2.Name = "Talle";
            service.Add(feature2);

            List <Feature> allFeatures = service.GetAll();

            Assert.AreEqual(2, allFeatures.Count());
            Feature savedFeature = allFeatures.Find(ft => ft.Id == feature.Id);

            Assert.IsNotNull(savedFeature);
            Feature savedFeature2 = allFeatures.Find(ft => ft.Id == feature2.Id);

            Assert.IsNotNull(savedFeature2);
        }
コード例 #2
0
        public void AttributeExistingTypeWithNameTest()
        {
            FeatureService service = getService();
            Feature        feature = new Feature();

            feature.Type = FeatureTypes.STRING;
            feature.Name = "Color";
            service.Add(feature);

            Feature feature2 = new Feature();

            feature2.Type = FeatureTypes.STRING;
            feature2.Name = "Color";
            service.Add(feature);
            service.Add(feature2);
        }
コード例 #3
0
        public void AttributeCreateNoTypeTest()
        {
            FeatureService service = getService();
            Feature        feature = new Feature();

            feature.Name = "Color";
            service.Add(feature);
        }
コード例 #4
0
        public void AttributeCreateNoNameTest()
        {
            FeatureService service = getService();
            Feature        feature = new Feature();

            feature.Type = 10;
            service.Add(feature);
        }
コード例 #5
0
        public void AttributeCreateDateOkTest()
        {
            FeatureService service = getService();
            Feature        feature = new Feature();

            feature.Type = FeatureTypes.DATE;
            feature.Name = "Vencimiento";
            service.Add(feature);
            GenericRepository <Feature> repo = new GenericRepository <Feature>(getContext());

            Feature savedFeature = repo.Get(feature.Id);

            Assert.IsNotNull(savedFeature);
        }
コード例 #6
0
        public void AttributeCreateStringOkTest()
        {
            FeatureService service = getService();
            Feature        feature = new Feature();

            feature.Type = FeatureTypes.STRING;
            feature.Name = "Color";
            service.Add(feature);

            GenericRepository <Feature> repo = new GenericRepository <Feature>(getContext());

            Feature savedFeature = repo.Get(feature.Id);

            Assert.IsNotNull(savedFeature);
        }