public void GetThemaTable02()
{
    BeheerThemasService beheerThemasService;
    BeheerThemasController beheerThemasController;
    IList<Thema> iList;
    Thema s0 = new Thema();
    s0.Id = 0L;
    s0.ThemaNaam = (string)null;
    beheerThemasService = BeheerThemasServiceFactory.Create(s0);
    beheerThemasController = BeheerThemasControllerFactory.Create
        ((IBeheerThemasService)beheerThemasService, false, (Thema)null, 
        (Thema)null, false, false);
    iList = this.GetThemaTable(beheerThemasController);
    Assert.IsNotNull((object)iList);
    Assert.IsNotNull((object)beheerThemasController);
    Assert.IsNotNull(beheerThemasController.ThemaTable);
    Assert.IsTrue
        (object.ReferenceEquals(beheerThemasController.ThemaTable, (object)iList));
    Assert.IsNotNull(beheerThemasController.BeheerThemasService);
    Assert.AreEqual<bool>(false, beheerThemasController.AddThemaCalled);
    Assert.IsNull(beheerThemasController.UpdatedThema);
    Assert.IsNull(beheerThemasController.DeletedThema);
    Assert.AreEqual<bool>(false, beheerThemasController.DeleteThemaCalled);
    Assert.AreEqual<bool>(false, beheerThemasController.UpdateThemaCalled);
}
 public override void DeleteThema(Thema thema)
 {
     Thema found = FindThema(m_ThemaTable, thema);
     if (found != null)
     {
         bool succeeded = m_ThemaTable.Remove(found);
     }
 }
 public override void UpdateThema(Thema thema)
 {
     Thema found = FindThema(m_ThemaTable, thema);
     if (found != null)
     {
         found.ThemaNaam = thema.ThemaNaam;
     }
 }
 public override void AddThema(Thema thema)
 {
     if (thema == null)
         throw new ArgumentNullException("thema");
     thema.Id = m_Id;
     m_ThemaTable.Add(thema);
     m_Id++;
 }
 public override void AddThema(Thema thema)
 {
     AddThemaCalled = true;
     if (m_ThemaTable == null)
     {
         m_ThemaTable = new List<Thema>();
     }
     m_ThemaTable.Add(thema);
     MockThemas = m_ThemaTable as List<Thema>;
 }
 internal static Thema FindThema(IList<Thema> themas, Thema thema)
 {
     // <pex>
     if (thema == (Thema)null)
         throw new ArgumentNullException("thema");
     // </pex>
     var result = from aThema in themas 
                  where aThema.Id.Equals(thema.Id)
                  select aThema;
                  
     return result.FirstOrDefault();
 }
 public virtual void UpdateThema(Thema thema)
 {
     // <pex>
     if (thema == (Thema)null)
         throw new ArgumentNullException("thema");
     // </pex>
     Thema found = FindThema(m_ThemaTable, thema);
     if (found != null)
     {
         found.ThemaNaam = thema.ThemaNaam;
     }
 }
public void GetThemaTable01()
{
    BeheerThemasService beheerThemasService;
    IList<Thema> iList;
    Thema s0 = new Thema();
    s0.Id = 0L;
    s0.ThemaNaam = (string)null;
    beheerThemasService = BeheerThemasServiceFactory.Create(s0);
    iList = this.GetThemaTable(beheerThemasService);
    Assert.IsNotNull((object)iList);
    Assert.IsNotNull((object)beheerThemasService);
}
        public virtual void AddThema(Thema thema)
        {
            // <pex>
            if (thema == (Thema)null)
                throw new ArgumentNullException("thema");
            // </pex>
            Thread.Sleep(1000);
            if(thema.ThemaNaam.Equals("1"))
                throw new BusinessLayerException("duplicate");

            thema.Id = m_Id;
            m_ThemaTable.Add(thema);
            m_Id++;
        }
 public void OnThemaAddedCallsControlerAddThemaTest()
 {
     //Arrange
     var controller = new MockBeheerThemasController();
     Thema thema = new Thema { ThemaNaam = "added" };
     BeheerThemasPresenter presenter = new BeheerThemasPresenter(controller);
     MockBeheerThemasView view = new MockBeheerThemasView();
     
     //Act            
     presenter.OnThemasAdded(thema);
     
     //Asserts
     Assert.IsTrue(controller.AddThemaCalled);
     Assert.AreSame(thema, controller.MockThemas[0]);
 }
        public void OnViewLoadedSetsTransfersIntheView()
        {
            //Arrange
            var controller = new MockBeheerThemasController();
            Thema thema = new Thema{ThemaNaam="test1"};
            controller.MockThemas.Add(thema);
            BeheerThemasPresenter presenter = new BeheerThemasPresenter(controller);
            MockBeheerThemasView view = new MockBeheerThemasView();
            presenter.View = view;
            
            //Act            
            presenter.OnViewLoaded();

            //Assert
            Assert.AreEqual(1, view.ThemaTable.Count);
            Assert.AreSame(thema, view.ThemaTable[view.ThemaTable.Count-1]);
        }
public void Constructor03()
{
    BeheerThemasService beheerThemasService;
    BeheerThemasController beheerThemasController;
    Thema s0 = new Thema();
    s0.Id = 0L;
    s0.ThemaNaam = (string)null;
    beheerThemasService = BeheerThemasServiceFactory.Create(s0);
    beheerThemasController =
      this.Constructor((IBeheerThemasService)beheerThemasService);
    Assert.IsNotNull((object)beheerThemasController);
    Assert.IsNull(beheerThemasController.ThemaTable);
    Assert.IsNotNull(beheerThemasController.BeheerThemasService);
    Assert.AreEqual<bool>(false, beheerThemasController.AddThemaCalled);
    Assert.IsNull(beheerThemasController.UpdatedThema);
    Assert.IsNull(beheerThemasController.DeletedThema);
    Assert.AreEqual<bool>(false, beheerThemasController.DeleteThemaCalled);
    Assert.AreEqual<bool>(false, beheerThemasController.UpdateThemaCalled);
}
public void GetThemaTable03()
{
    MockBeheerThemasService mockBeheerThemasService;
    MockBeheerThemasController mockBeheerThemasController;
    IList<Thema> iList;
    Thema s0 = new Thema();
    s0.Id = 0L;
    s0.ThemaNaam = (string)null;
    mockBeheerThemasService = MockBeheerThemasServiceFactory.Create(s0);
    mockBeheerThemasController =
      new MockBeheerThemasController(mockBeheerThemasService);
    mockBeheerThemasController.AddThemaCalled = false;
    mockBeheerThemasController.DeleteThemaCalled = false;
    mockBeheerThemasController.UpdateThemaCalled = false;
    mockBeheerThemasController.UpdatedThema = (Thema)null;
    mockBeheerThemasController.DeletedThema = (Thema)null;
    mockBeheerThemasController.AddThema((Thema)null);
    iList = this.GetThemaTable(mockBeheerThemasController);
    Assert.IsNotNull((object)iList);
    Assert.IsNotNull((object)mockBeheerThemasController);
    Assert.IsNotNull(mockBeheerThemasController.MockThemas);
    Assert.IsTrue(
    object.ReferenceEquals(mockBeheerThemasController.MockThemas, (object)iList)
    );
    Assert.AreEqual<bool>(true, mockBeheerThemasController.AddThemaCalled);
    Assert.AreEqual<bool>(false, mockBeheerThemasController.DeleteThemaCalled);
    Assert.AreEqual<bool>(false, mockBeheerThemasController.UpdateThemaCalled);
    Assert.IsNull(mockBeheerThemasController.UpdatedThema);
    Assert.IsNull(mockBeheerThemasController.DeletedThema);
    Assert.IsNull(((BeheerThemasController)mockBeheerThemasController).ThemaTable);
    Assert.IsNull
        (((BeheerThemasController)mockBeheerThemasController).BeheerThemasService);
    Assert.AreEqual<bool>
        (true, ((BeheerThemasController)mockBeheerThemasController).AddThemaCalled);
    Assert.IsNull(((BeheerThemasController)mockBeheerThemasController).UpdatedThema);
    Assert.IsNull(((BeheerThemasController)mockBeheerThemasController).DeletedThema);
    Assert.AreEqual<bool>(false, 
    ((BeheerThemasController)mockBeheerThemasController).DeleteThemaCalled);
    Assert.AreEqual<bool>(false, 
    ((BeheerThemasController)mockBeheerThemasController).UpdateThemaCalled);
}
public void BeheerThemasServiceGet01()
{
    MockBeheerThemasService mockBeheerThemasService;
    BeheerThemasController beheerThemasController;
    Thema s0 = new Thema();
    s0.Id = 0L;
    s0.ThemaNaam = (string)null;
    mockBeheerThemasService = MockBeheerThemasServiceFactory.Create(s0);
    beheerThemasController = BeheerThemasControllerFactory.Create
        ((IBeheerThemasService)mockBeheerThemasService, false, (Thema)null, 
        (Thema)null, false, false);
    this.BeheerThemasServiceGet(beheerThemasController);
    Assert.IsNotNull((object)beheerThemasController);
    Assert.IsNull(beheerThemasController.ThemaTable);
    Assert.IsNotNull(beheerThemasController.BeheerThemasService);
    Assert.AreEqual<bool>(false, beheerThemasController.AddThemaCalled);
    Assert.IsNull(beheerThemasController.UpdatedThema);
    Assert.IsNull(beheerThemasController.DeletedThema);
    Assert.AreEqual<bool>(false, beheerThemasController.DeleteThemaCalled);
    Assert.AreEqual<bool>(false, beheerThemasController.UpdateThemaCalled);
}
 public virtual void UpdateThema([PexAssumeUnderTest]MockBeheerThemasService target, Thema thema)
 {
     target.UpdateThema(thema);
 }
 public virtual void UpdateThema(Thema thema)
 {
     UpdateThemaCalled = true;
     BeheerThemasService.UpdateThema(thema);
 }
 public virtual void DeleteThema(Thema thema)
 {
     DeleteThemaCalled = true;
     BeheerThemasService.DeleteThema(thema);
 }
 public virtual void AddThema(Thema thema)
 {
     AddThemaCalled = true;
     BeheerThemasService.AddThema(thema);
 }
 public override void UpdateThema(Thema thema)
 {
     UpdateThemaCalled = true;
     UpdatedThema = thema;
 }
        public virtual void DeleteThema([PexAssumeUnderTest]BeheerThemasService target, Thema thema)
        {
            target.DeleteThema(thema);

        }
        public virtual void DeleteThema([PexAssumeUnderTest]BeheerThemasController target, Thema thema)
        {
            target.DeleteThema(thema);

        }
 public virtual void UpdateThema([PexAssumeUnderTest]MockBeheerThemasController target, Thema thema)
 {
     target.UpdateThema(thema);
 }
 public override void DeleteThema(Thema thema)
 {
     DeleteThemaCalled = true;
     DeletedThema = thema;
 }