public void GetAllForProgram() { // Arrange var controller = new FormsController(InitRepo()); // Act var forms = controller.Get(1); // Assert Assert.IsNotNull(forms); Assert.AreEqual(2, forms.Count()); }
public void TestNoLanguage() { // Arrange var controller = new FormsController(InitRepo()); // Act var form = controller.Get(1, 1); // Assert Assert.IsNull(form.Label); Assert.AreEqual(2, form.Labels.Count()); }
public void TestFrench() { // Arrange var controller = new FormsController(InitRepo()); controller.SetHeaders(new Dictionary <string, string> { { "ACCEPT-LANGUAGE", "fr" } }); // Act var form = controller.Get(1, 1); // Assert Assert.AreEqual(form.Label, "Test fr"); Assert.IsNull(form.Labels); }
public void GetOne() { // Arrange var controller = new FormsController(InitRepo()); controller.SetHeaders(new Dictionary <string, string> { { "ACCEPT-LANGUAGE", "en" } }); // Act var form = controller.Get(1, 2); // Assert Assert.IsNotNull(form); Assert.AreEqual(form.Label, "Form 2"); Assert.IsNotNull(form.Sections); Assert.AreEqual(3, form.Sections.Count); }