public void AddInsertedEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view.CallOnInserted(); Assert.IsTrue(control._InsertedFired); }
public void SetUsingServerPagingForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.UsingServerPaging = true; Assert.IsTrue(control._view._usingServerPaging); }
public void AddUpdatedEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view.CallOnUpdated(); Assert.IsTrue(control._UpdatedFired); }
public void SetDataObjectTypeNameForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.DataObjectTypeName = "typeName"; Assert.AreEqual("typeName", control._view._dataObjectTypeName); }
public void AddSelectingEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view.CallOnSelecting(); Assert.IsTrue(control._SelectingFired); }
public void AddDeletingEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view.CallOnDeleting(); Assert.IsTrue(control._DeletingFired); }
public void SetTotalRowCountForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.TotalRowCount = 5; Assert.AreEqual(5, control._view._totalRowCount); }
public void GetViewNamesReturnsAlwaysTheSameCollection() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); ICollection result1 = control.TestGetViewNames(); ICollection result2 = control.TestGetViewNames(); Assert.AreSame(result1, result2); }
public void RemoveSelectingEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.RemoveEventSubscriptions(); control._view.CallOnSelecting(); Assert.IsFalse(control._UpdatingFired); }
public void RemoveInsertedEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.RemoveEventSubscriptions(); control._view.CallOnInserted(); Assert.IsFalse(control._InsertedFired); }
public void GetViewReturnsDefaultViewIfViewNameIsEmpty() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); DataSourceView result = control.TestGetView(String.Empty); Assert.IsTrue(result is ObjectContainerDataSourceView); Assert.AreEqual("DefaultView", result.Name); }
public void GetViewReturnsCorrectView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); DataSourceView result = control.TestGetView("DefaultView"); Assert.IsTrue(result is ObjectContainerDataSourceView); Assert.AreEqual("DefaultView", result.Name); }
public void GetViewNamesReturnsDefaultViewOnly() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); ArrayList viewNames = new ArrayList(control.TestGetViewNames()); Assert.AreEqual(1, viewNames.Count); Assert.IsTrue(viewNames.Contains("DefaultView")); }
public void GetDataObjectTypeNameForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view._dataObjectTypeName = "typeName"; string result = control.DataObjectTypeName; Assert.AreEqual("typeName", result); }
public void SetDataSourceForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); object obj = new object(); control.DataSource = obj; Assert.AreSame(obj, control._view._dataSource); }
public void GetUsingServerSortingForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view.UsingServerSorting = true; bool result = control.UsingServerSorting; Assert.IsTrue(result); }
public void GetItemsForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); List <object> items = new List <object>(1); object item = new object(); items.Add(item); control._view._items = items; ReadOnlyCollection <object> result = control.Items; Assert.AreSame(item, result[0]); Assert.AreEqual(1, result.Count); }
public void GetDataObjectTypeNameForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view._dataObjectTypeName = "typeName"; string result = control.DataObjectTypeName; Assert.AreEqual("typeName", result); }
public void GetViewThrowsIfNotDefaultView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); DataSourceView result = control.TestGetView("DefaultView1"); }
public void SetUsingServerSortingForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.UsingServerSorting = true; Assert.IsTrue(control._view._usingServerSorting); }
public void SetTotalRowCountForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.TotalRowCount = 5; Assert.AreEqual(5, control._view._totalRowCount); }
public void SetDataSourceForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); object obj = new object(); control.DataSource = obj; Assert.AreSame(obj, control._view._dataSource); }
public void SetDataObjectTypeNameForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.DataObjectTypeName = "typeName"; Assert.AreEqual("typeName", control._view._dataObjectTypeName); }
public void RemoveUpdatingEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.RemoveEventSubscriptions(); control._view.CallOnUpdating(); Assert.IsFalse(control._UpdatingFired); }
public void RemoveDeletedEventForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control.RemoveEventSubscriptions(); control._view.CallOnDeleted(); Assert.IsFalse(control._DeletedFired); }
public void GetViewThrowsIfNotDefaultView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); DataSourceView result = control.TestGetView("DefaultView1"); }
public void GetViewReturnsDefaultViewIfViewNameIsNull() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); DataSourceView result = control.TestGetView(null); Assert.IsTrue(result is ObjectContainerDataSourceView); Assert.AreEqual("DefaultView", result.Name); }
public void GetViewNamesReturnsDefaultViewOnly() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); ArrayList viewNames = new ArrayList(control.TestGetViewNames()); Assert.AreEqual(1, viewNames.Count); Assert.IsTrue(viewNames.Contains("DefaultView")); }
public void GetViewNamesReturnsAlwaysTheSameCollection() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); ICollection result1 = control.TestGetViewNames(); ICollection result2 = control.TestGetViewNames(); Assert.AreSame(result1, result2); }
public void GetUsingServerSortingForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); control._view.UsingServerSorting = true; bool result = control.UsingServerSorting; Assert.IsTrue(result); }
public void GetItemsForwardsToView() { TestableObjectContainerDataSource control = new TestableObjectContainerDataSource(); List<object> items = new List<object>(1); object item = new object(); items.Add(item); control._view._items = items; ReadOnlyCollection<object> result = control.Items; Assert.AreSame(item, result[0]); Assert.AreEqual(1, result.Count); }