public void AreaNameTest() { SymNetAreaRegistration target = new SymNetAreaRegistration(); string actual; string expected = "SymNet"; actual = target.AreaName; Assert.AreEqual(expected,actual); }
public void RegisterAreaTestWithMockContext() { MockRepository mocks = new MockRepository(); //Mock the AreaRegistrationContext AreaRegistrationContext context = (AreaRegistrationContext)mocks.StrictMock(typeof(AreaRegistrationContext), "SymNet",new RouteCollection()); SymNetAreaRegistration target = new SymNetAreaRegistration(); using (mocks.Record()) {} //Play the test using (mocks.Playback()) { target.RegisterArea(context); } Assert.AreEqual(1, context.Routes.Count); }
public void RegisterAreaTestWithNullContext() { SymNetAreaRegistration target = new SymNetAreaRegistration(); AreaRegistrationContext context = null; try { target.RegisterArea(context); Assert.Fail("Call to RegisterArea with null context should throw ArgumentNullException"); } catch (Exception ex) { Assert.IsInstanceOfType(ex, typeof(ArgumentNullException)); } }