public void TestInitialize() { factories = Substitute.For<Factories>(); fixture = new Fixture(); factories.Categories.Returns(fixture.CreateMany<Category>().ToList()); categories = factories.Categories.Select(category => new CategoryViewModel(category, factories)).ToList(); product = new Product { CategoryId = factories.Categories.First().Id }; product.SetOwner(factories); overrideCategory = new CategoryViewModel(new Category(), factories); }
private void SetupProducts() { var product = new Product(); product.SetOwner(factories); product.Id = Guid.NewGuid(); product.AddedByUser = true; factories.Products.Returns(new List<Product> { product }); factories.CreateProduct().Returns(_ => { factories.Products.Add(product); return product; }); }