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); }
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); }
public void AttributeCreateNoTypeTest() { FeatureService service = getService(); Feature feature = new Feature(); feature.Name = "Color"; service.Add(feature); }
public void AttributeCreateNoNameTest() { FeatureService service = getService(); Feature feature = new Feature(); feature.Type = 10; service.Add(feature); }
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); }
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); }