Files
yavsc/SalesCatalog/Tests/TestBrands.cs
Paul Schneider 3dbf0265db * SalesCatalog.csproj: clean an unused reference
* TestBrands.cs:
* Service.cs:
* PhysicalProduct.cs: clean an obsolete reference

* TestCatalogInit.cs: cleaner

* XmlCatalog.cs:
* XmlCatalogProvider.cs: suppressed some xml doc warnings

* Estimate.aspx: new jQuery version 

* Web.config: removed a section dotNetOpenAuth at using the .Net
  framework 4.5.1
2015-01-29 23:05:57 +01:00

34 lines
711 B
C#

#if TEST
using NUnit.Framework;
using System;
namespace SalesCatalog.Tests
{
[TestFixture ()]
public class TestBrands
{
[Test ()]
public void TestCaseAddRemoveBrand ()
{
Catalog c = new Catalog ();
c.Brands = new Brand[0];
Brand b=c.AddBrand ("coko");
if (c.Brands.Length != 1)
throw new Exception ("Pas ajouté");
if (b == null)
throw new Exception ("Renvoyé null");
if (b.Name != "coko")
throw new Exception ("Pas le bon nom");
if (c.Brands [0] != b)
throw new Exception ("err index 0");
if (c.GetBrand ("coko") != b)
throw new Exception ("err get by name");
if (!c.RemoveBrand ("coko"))
throw new Exception ("Pas supprimé");
}
}
}
#endif