Here are the examples of the csharp api NUnit.Framework.Assert.IsEmpty(System.Collections.IEnumerable) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
112 Examples
19
Source : OpenFromArasViewModelTest.cs
with MIT License
from arasplm
with MIT License
from arasplm
[Test]
[Ignore("Should be updated")]
public void SearchMethodDialogCommandExcecute_ShouldSetExpectedPropertyValue()
{
//Arange
ISearcher searcher = Subsreplacedute.For<ISearcher>();
IItemSearchView searchView = Subsreplacedute.For<IItemSearchView>();
ItemSearchPresenter itemSearchPresenter = Subsreplacedute.ForPartsOf<ItemSearchPresenter>(searchView, searcher);
itemSearchPresenter.When(x => x.Run(Arg.Any<ItemSearchPresenterArgs>())).DoNotCallBase();
this.dialogFactory.GereplacedemSearchPresenter("Method", "Method").Returns(itemSearchPresenter);
this.projectConfigurationManager.CurrentProjectConfiguraiton.LastSavedSearch.Returns(new Dictionary<string, List<PropertyInfo>>());
ItemSearchPresenterResult searchResult = new ItemSearchPresenterResult()
{
DialogResult = DialogResult.OK,
ItemType = "Method",
ItemId = "1BF96D4255962F7EA5970426401A841E"
};
itemSearchPresenter.Run(Arg.Any<ItemSearchPresenterArgs>()).Returns(searchResult);
this.serverConnection.When(x => x.CallAction("ApplyItem", Arg.Any<XmlDoreplacedent>(), Arg.Any<XmlDoreplacedent>()))
.Do(callBack =>
{
(callBack[2] as XmlDoreplacedent).Load(Path.Combine(currentPath, @"Dialogs\ViewModels\TestData\TestMethodItem.xml"));
});
//Act
this.openFromArasViewModel.SearchMethodDialogCommand.Execute(null);
//replacedert
replacedert.AreEqual("ReturnNullMethodName", this.openFromArasViewModel.MethodName);
replacedert.AreEqual("1BF96D4255962F7EA5970426401A841E", this.openFromArasViewModel.MethodId);
replacedert.AreEqual("616634B3DC344D51964CD7AD988051D7", this.openFromArasViewModel.MethodConfigId);
replacedert.AreEqual("C#", this.openFromArasViewModel.MethodLanguage);
replacedert.AreEqual("World", this.openFromArasViewModel.IdenreplacedyKeyedName);
replacedert.AreEqual("A73B655731924CD0B027E4F4D5FCC0A9", this.openFromArasViewModel.IdenreplacedyId);
replacedert.IsEmpty(this.openFromArasViewModel.MethodComment);
replacedert.AreEqual("server", this.openFromArasViewModel.MethodType);
replacedert.AreEqual("return null;", this.openFromArasViewModel.MethodCode);
replacedert.IsNull(this.openFromArasViewModel.SelectedTemplate);
replacedert.AreEqual(1, this.projectConfigurationManager.CurrentProjectConfiguraiton.LastSavedSearch.Count);
}
19
Source : DelayedListTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void Add_Unprocessed_NotAddedYet()
{
var list = new DelayedList<object>();
list.Add(new object());
replacedert.IsEmpty(list);
}
19
Source : DelayedListTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void Remove_Empty_Processed_NothingChanged()
{
var list = new DelayedList<object>();
var item = new object();
list.Remove(item);
list.ProcessPending();
replacedert.IsEmpty(list);
}
19
Source : DelayedListTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void AddThenClear_Processed_NoItemsAdded()
{
var list = new DelayedList<object>();
Fill(list, 5);
list.Clear();
list.ProcessPending();
replacedert.IsEmpty(list);
}
19
Source : DelayedListTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void Clear_Processed_AllItemsRemoved()
{
var list = new DelayedList<object>();
Fill(list, 5);
list.ProcessPending();
list.Clear();
list.ProcessPending();
replacedert.IsEmpty(list);
}
19
Source : DelayedListTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void ClearInstantly_Unprocessed_AllItemsRemoved()
{
var list = new DelayedList<object>();
Fill(list, 5);
list.ProcessPending();
list.ClearInstantly();
replacedert.IsEmpty(list);
}
19
Source : DelayedListTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void AddThenClearPending_Processed_NoItemsAdded()
{
var list = new DelayedList<object>();
Fill(list, 5);
list.ClearPending();
list.ProcessPending();
replacedert.IsEmpty(list);
}
19
Source : EventTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void RemoveListener_Empty_NoChange()
{
var e = new Event(0);
var interfaceListener = new InterfaceListener(null);
Action delegateListener = () => { };
e.RemoveListener(interfaceListener);
e.RemoveListener(delegateListener);
replacedert.IsEmpty(e.Listeners);
}
19
Source : EventTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void Clear_AllListenersRemoved()
{
var e = new Event(0);
for (var i = 0; i < 10; i++)
{
e.AddListener(new InterfaceListener(null));
e.AddListener(() => { });
}
e.Clear();
replacedert.IsEmpty(e.Listeners);
}
19
Source : Bin2DTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void Retrieve_Empty_NoResults()
{
var bin = new Bin2D<object>(9, 9, 1, 1);
var rect = GetRectInsideCells(-1, -1, bin.Width, bin.Height, bin.CellWidth, bin.CellHeight);
var results = new HashSet<object>();
bin.Retrieve(rect, results);
replacedert.IsEmpty(results);
}
19
Source : Bin3DTests.cs
with MIT License
from ArchonInteractive
with MIT License
from ArchonInteractive
[Test]
public void Retrieve_Empty_NoResults()
{
var bin = new Bin3D<object>(9, 9, 9, 1, 1, 1);
var rect = GetBoundsInsideCells(-1, -1, -1, bin.Width, bin.Height, bin.Depth, bin.CellWidth, bin.CellHeight, bin.CellDepth);
var results = new HashSet<object>();
bin.Retrieve(rect, results);
replacedert.IsEmpty(results);
}
19
Source : PresenterTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void Present_FailsIf_ControllerCtorThrows()
{
var presentResult = _presenter.Present<EventsController>(new PresentArgs<ControllerEvents>(ControllerEvents.Ctor));
replacedert.IsEmpty(_presenter.Controllers);
replacedert.NotNull(presentResult);
replacedert.Null(presentResult.Controller);
replacedert.True(presentResult.IsDismissed);
replacedert.True(presentResult.Task.IsFaulted);
replacedert.NotNull(presentResult.Task.Exception);
}
19
Source : PresenterTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void Present_FailsIf_OnDismissThrows()
{
var presentResult = _presenter.Present<EventsController>(new PresentArgs<ControllerEvents>(ControllerEvents.Dismiss));
presentResult.Dispose();
replacedert.IsEmpty(_presenter.Controllers);
replacedert.NotNull(presentResult);
replacedert.True(presentResult.IsDismissed);
replacedert.True(presentResult.Task.IsFaulted);
replacedert.NotNull(presentResult.Task.Exception);
}
19
Source : PresentResultTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void Dispose_DismissesController()
{
var presentResult = _presenter.Present<MinimalController>();
presentResult.Dispose();
replacedert.True(presentResult.IsDismissed);
replacedert.IsNull(_presenter.ActiveController);
replacedert.IsEmpty(_presenter.Controllers);
}
19
Source : PresenterTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void Present_FailsIf_OnPresentThrows()
{
var presentResult = _presenter.Present<EventsController>(new PresentArgs<ControllerEvents>(ControllerEvents.Present));
_updateLoop.Update();
replacedert.IsEmpty(_presenter.Controllers);
replacedert.NotNull(presentResult);
replacedert.AreEqual(0, presentResult.Controller.ActivateCallId);
replacedert.AreEqual(0, presentResult.Controller.DeactivateCallId);
replacedert.AreEqual(0, presentResult.Controller.DismissCallId);
replacedert.True(presentResult.IsDismissed);
replacedert.True(presentResult.Task.IsFaulted);
replacedert.NotNull(presentResult.Task.Exception);
}
19
Source : ViewFactoryTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void InitialStateIsValid()
{
replacedert.NotNull(_viewFactory.Views);
replacedert.IsEmpty(_viewFactory.Views);
}
19
Source : OutlineLayerCollectionTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void DefaultStateIsValid()
{
replacedert.IsFalse(_layerCollection.IsReadOnly);
replacedert.IsEmpty(_layerCollection);
replacedert.Zero(_layerCollection.Count);
}
19
Source : PresenterTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void InitialStateIsValid()
{
replacedert.AreEqual(_serviceProvider, _presenter.ServiceProvider);
replacedert.AreEqual(_viewFactory, _presenter.ViewFactory);
replacedert.IsNull(_presenter.ActiveController);
replacedert.IsEmpty(_presenter.Controllers);
}
19
Source : OutlineLayerTests.cs
with MIT License
from Arvtesh
with MIT License
from Arvtesh
[Test]
public void DefaultStateIsValid()
{
replacedert.IsFalse(_layer.IsReadOnly);
replacedert.IsEmpty(_layer);
replacedert.Zero(_layer.Count);
replacedert.AreEqual("TestLayer", _layer.Name);
replacedert.AreEqual(-1, _layer.Index);
}
19
Source : CompCurvesCollectionTest.cs
with MIT License
from Autodesk
with MIT License
from Autodesk
[Test]
public void CreateIntersectionFailureTest()
{
// Import two surfaces
var activeModel = _powerSHAPE.ActiveModel;
activeModel.Import(new File(TestFiles.THREE_SURFACES));
var surface1 = activeModel.Surfaces[0];
var surface2 = activeModel.Surfaces[1];
var intersections = activeModel.CompCurves.CreateCompCurvesFromIntersectionOfTwoSurfaces(surface1, surface2);
replacedert.IsEmpty(intersections);
}
19
Source : CompCurveTest.cs
with MIT License
from Autodesk
with MIT License
from Autodesk
[Test]
public void LimitCompCurveToEnreplacediesFailureTest()
{
var activeModel = _powerSHAPE.ActiveModel;
activeModel.Import(new File(TestFiles.THREE_COMPCURVES));
var curve1 = activeModel.CompCurves[0];
var curve2 = activeModel.CompCurves[1];
var result = curve1.LimitToEnreplacedy(curve2);
replacedert.IsEmpty(result);
}
19
Source : Wrappers.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test] public void Example()
{
var container = new Container();
var items = container.Resolve<Meta<A, int>[]>();
replacedert.IsEmpty(items);
}
19
Source : Issue579_VerifyResolutions_strange_behaviour.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Minimal_test()
{
var container = new Container(rules => rules.WithoutThrowIfDependencyHreplacedhorterReuseLifespan());
container.Register<fiosEnreplacedies>(Reuse.InWebRequest, setup: Setup.With(openResolutionScope: true));
var errors = container.Validate();
replacedert.IsEmpty(errors);
}
19
Source : Issue579_VerifyResolutions_strange_behaviour.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Close_to_real_test()
{
var container = new Container();
container.Register<fiosEnreplacedies>(setup: Setup.With(openResolutionScope: true));
container.Register(typeof(IGenericExecutor<>), typeof(GenericExecutor<>), Reuse.Singleton);
container.Register<IBaseParams, BaseParams>(Reuse.Singleton);
container.Register<IDataCheck, DataCheck>(Reuse.Singleton);
container.Register<IReportUtilities, ReportUtilities>(Reuse.Singleton);
container.Register<IResponseProvider, JsonResponseProvider>(Reuse.Singleton);
container.Register<IRelationshipsService, RelationshipsService>(Reuse.Singleton);
container.Register<IBusinessService, BusinessService>(Reuse.Singleton);
container.Register<ISurveysService, SurveysService>(Reuse.Singleton);
container.Register<IGenericService, GenericService>(Reuse.Singleton);
container.Register<IGenericDataService, GenericDataService>(Reuse.Singleton);
container.Register<IAccountsService, AccountsService>(Reuse.Singleton);
container.Register<IApplicationsService, ApplicationsService>(Reuse.Singleton);
container.Register<IInformationService, InformationService>(Reuse.Singleton);
container.Register<IReferenceDataService, ReferenceDataService>(Reuse.Singleton);
container.Register<IReportsService, ReportsService>(Reuse.Singleton);
container.Register<ITechnologiesService, TechnologiesService>(Reuse.Singleton);
container.Register<IUiService, UiService>(Reuse.Singleton);
var errors = container.Validate(ServiceInfo.Of<IBaseParams>());
replacedert.IsEmpty(errors);
}
19
Source : Issue123_TipsForMigrationFromAutofac.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void How_DryIoc_IEnumerable_handles_missing_service()
{
var container = new Container();
var x = container.Resolve<IEnumerable<NoDepService>>();
replacedert.IsEmpty(x);
}
19
Source : Issue473_Unable_to_match_service_with_open_generic.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Unable_to_match_in_ResolveMany()
{
var container = new Container();
container.RegisterMany(new[] { typeof(MyDictionary<>) });
var array = container.ResolveMany(typeof(IMyInterface), ResolveManyBehavior.AsFixedArray);
replacedert.IsEmpty(array);
array = container.ResolveMany(typeof(IMyInterface)).ToArray();
replacedert.IsEmpty(array);
}
19
Source : DryIocOwinMiddlewareTests.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public async Task Should_ignore_unresolved_middleware_due_missing_dependency()
{
var container = new Container();
container.Register<TestGreetingMiddleware>();
// Greeting dependency does not registered
using (var server = TestServer.Create(app => app.UseDryIocOwinMiddleware(container)))
{
var response = await server.HttpClient.GetAsync("/");
replacedert.IsEmpty(response.Content.ReadreplacedtringAsync().Result);
}
}
19
Source : ArrayToolsTest.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void For_all_not_matched_items_it_should_return_empty_array()
{
var a = new[] { 1, 2, 3, 4, 5 };
var b = a.Match(n => n < 0);
replacedert.IsEmpty(b);
}
19
Source : ArrayToolsTest.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Not_matched_item_in_one_item_array_should_return_original_array()
{
var a = new[] { 1 };
var b = a.Match(n => n < 0);
replacedert.IsEmpty(b);
}
19
Source : Issue123_TipsForMigrationFromAutofac.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void How_Autofac_IEnumerable_handles_missing_service()
{
var builder = new ContainerBuilder();
var container = builder.Build();
var x = container.Resolve<IEnumerable<NoDepService>>();
replacedert.IsEmpty(x);
}
19
Source : DryIocMvcTests.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Correct_filter_provider_subsreplacedution()
{
FilterProviders.Providers.Add(new FilterAttributeFilterProvider());
replacedert.IsNotEmpty(FilterProviders.Providers.OfType<FilterAttributeFilterProvider>());
new Container().WithMvc(new[] { typeof(DryIocMvcTests).replacedembly });
replacedert.IsEmpty(FilterProviders.Providers.OfType<FilterAttributeFilterProvider>()
.Except(FilterProviders.Providers.OfType<DryIocFilterAttributeFilterProvider>()));
replacedert.AreEqual(1, FilterProviders.Providers.OfType<DryIocFilterAttributeFilterProvider>().Count());
}
19
Source : ContainerTests.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Can_generate_expressions_from_many_open_generic_registrations()
{
var c = new Container();
c.RegisterMany(new[] { typeof(OG1<>), typeof(OG2<>) }, serviceTypeCondition: Registrator.Interfaces);
var result = c.GenerateResolutionExpressions(regs =>
regs.Select(r => r.ServiceType == typeof(IG<>) ? r.ToServiceInfo<IG<int>>() : r.ToServiceInfo()));
replacedert.IsEmpty(result.Errors);
Collectionreplacedert.AreEquivalent(
new[] { typeof(OG1<int>), typeof(OG2<int>) },
result.Roots.Select(e => e.Value.Body.Type));
}
19
Source : ContainerTests.cs
with MIT License
from dadhi
with MIT License
from dadhi
[Test]
public void Can_generate_expressions_from_closed_and_open_generic_registrations_via_required_service_type()
{
var c = new Container();
c.RegisterMany(new[] { typeof(CS), typeof(OG1<>) }, serviceTypeCondition: Registrator.Interfaces);
var result = c.GenerateResolutionExpressions(regs =>
regs.Select(r => r.ServiceType == typeof(IG<>) ? r.ToServiceInfo<IG<string>>() : r.ToServiceInfo()));
replacedert.IsEmpty(result.Errors);
Collectionreplacedert.AreEquivalent(
new[] { typeof(CS), typeof(OG1<string>) },
result.Roots.Select(e => e.Value.Body.Type));
}
19
Source : SymbolsUxBuilderTests.cs
with MIT License
from fuse-open
with MIT License
from fuse-open
[Test]
public void NoSymbolsInSketchDoreplacedentProducesInfo()
{
var doreplacedent = DoreplacedentBuilder.SketchDoreplacedent();
var logger = new MessageListLogger();
var builder = new SymbolsUxBuilder(logger);
builder.Build(doreplacedent, _outputDirectory);
var files = Directory.EnumerateFiles(_outputDirectory);
replacedert.IsEmpty(files);
replacedert.AreEqual(1, logger.Messages.Count);
replacedert.That(logger.Messages.First(), Does.Match("INFO.*No UX generated"));
}
19
Source : TestCheckBoxes.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void TestCheckedAspectName() {
foreach (Person p in PersonDb.All)
p.IsActive = false;
this.olv.CheckedAspectName = "IsActive";
this.olv.SetObjects(PersonDb.All);
replacedert.IsEmpty(this.olv.CheckedObjects);
foreach (Person p in PersonDb.All)
p.IsActive = true;
this.olv.SetObjects(PersonDb.All);
replacedert.AreEqual(PersonDb.All.Count, this.olv.CheckedObjects.Count);
this.olv.CheckedAspectName = null;
}
19
Source : TestSelection.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void TestSelectedObjects()
{
replacedert.IsEmpty(this.olv.SelectedObjects);
this.olv.SelectedObjects = PersonDb.All;
replacedert.AreEqual(PersonDb.All, this.olv.SelectedObjects);
this.olv.SelectedObjects = null;
replacedert.IsEmpty(this.olv.SelectedObjects);
}
19
Source : TestSelection.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void TestDeselectAll()
{
this.olv.SelectedObject = PersonDb.All[1];
replacedert.IsNotEmpty(this.olv.SelectedObjects);
this.olv.DeselectAll();
replacedert.IsEmpty(this.olv.SelectedObjects);
this.olv.SelectAll();
replacedert.IsNotEmpty(this.olv.SelectedObjects);
this.olv.DeselectAll();
replacedert.IsEmpty(this.olv.SelectedObjects);
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void TestGetChildrenLeaf() {
Person p = PersonDb.All[0];
replacedert.IsEmpty((IList)this.olv.GetChildren(p.Children[0]));
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void TestExpandedObjects() {
this.olv.ExpandedObjects = new Person[] {PersonDb.All[1]};
replacedert.Contains(PersonDb.All[1], this.olv.ExpandedObjects as ICollection);
this.olv.ExpandedObjects = null;
replacedert.IsEmpty(this.olv.ExpandedObjects as ICollection);
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void TestPreserveExpansion() {
this.olv.Expand(PersonDb.All[1]);
replacedert.Contains(PersonDb.All[1], this.olv.ExpandedObjects as ICollection);
this.olv.Collapse(PersonDb.All[1]);
replacedert.IsEmpty(this.olv.ExpandedObjects as ICollection);
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_CheckedObjects_CheckingVisibleObjects() {
this.olv.CheckBoxes = true;
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
this.olv.Expand(firstRoot);
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.CheckedObjects = ObjectListView.EnumerableToArray(firstRoot.Children, true);
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(firstRoot.Children.Count, checkedObjects.Count);
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_CheckedObjects_CheckingHiddenObjects() {
this.olv.CheckBoxes = true;
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.CheckedObjects = ObjectListView.EnumerableToArray(firstRoot.Children, true);
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(firstRoot.Children.Count, checkedObjects.Count);
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes_Unrolled_CheckingParent_ChecksChildren() {
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
this.olv.Expand(firstRoot);
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.HierarchicalCheckboxes = true;
this.olv.CheckObject(firstRoot);
foreach (Person child in firstRoot.Children)
replacedert.IsTrue(this.olv.IsChecked(child));
this.olv.UncheckObject(firstRoot);
foreach (Person child in firstRoot.Children)
replacedert.IsFalse(this.olv.IsChecked(child));
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes() {
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.HierarchicalCheckboxes = true;
this.olv.CheckObject(firstRoot);
foreach (Person child in this.olv.GetChildren(firstRoot))
replacedert.IsTrue(this.olv.IsChecked(child));
this.olv.UncheckObject(firstRoot);
foreach (Person child in firstRoot.Children)
replacedert.IsFalse(this.olv.IsChecked(child));
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes_CheckedObjects_Get() {
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.HierarchicalCheckboxes = true;
this.olv.CheckObject(firstRoot);
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(1, checkedObjects.Count);
replacedert.IsTrue(checkedObjects.Contains(firstRoot));
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes_CheckedObjects_Get_IncludesExpandedChildren() {
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.HierarchicalCheckboxes = true;
this.olv.Expand(firstRoot);
this.olv.CheckObject(firstRoot);
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(1 + firstRoot.Children.Count, checkedObjects.Count);
replacedert.IsTrue(checkedObjects.Contains(firstRoot));
foreach (Person child in firstRoot.Children)
replacedert.IsTrue(checkedObjects.Contains(child));
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes_CheckedObjects_Get_IncludesCheckedObjectsNotInControl() {
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.HierarchicalCheckboxes = true;
this.olv.Expand(firstRoot);
Person newGuy = new Person("someone new");
this.olv.CheckObject(newGuy);
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(1, checkedObjects.Count);
replacedert.AreEqual(((Person)checkedObjects[0]).Name, newGuy.Name);
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes_CheckedObjects_Set_RecalculatesParent() {
Person firstRoot = PersonDb.All[0];
this.olv.CollapseAll();
replacedert.IsEmpty(this.olv.CheckedObjects);
this.olv.HierarchicalCheckboxes = true;
this.olv.CheckedObjects = ObjectListView.EnumerableToArray(firstRoot.Children, true);
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(1 + firstRoot.Children.Count, checkedObjects.Count);
replacedert.IsTrue(checkedObjects.Contains(firstRoot));
foreach (Person child in firstRoot.Children)
replacedert.IsTrue(checkedObjects.Contains(child));
}
19
Source : TestTreeView.cs
with GNU General Public License v3.0
from geomatics-io
with GNU General Public License v3.0
from geomatics-io
[Test]
public void Test_HierarchicalCheckBoxes_CheckedObjects_Set_DeeplyNestedObject() {
this.olv.HierarchicalCheckboxes = true;
replacedert.IsEmpty(this.olv.CheckedObjects);
// The tree structure is:
// GGP1
// +-- GP1
// +-- GP2
// +-- P1
// +-- last
// So checking "last" will also check P1 and GP2, and will make GGP1 indeterminate.
Person last = PersonDb.All[PersonDb.All.Count - 1];
Person P1 = last.Parent;
Person GP2 = last.Parent.Parent;
Person GGP1 = last.Parent.Parent.Parent;
Person GP1 = GGP1.Children[0];
ArrayList toBeChecked = new ArrayList();
toBeChecked.Add(last);
this.olv.CheckedObjects = toBeChecked;
ArrayList checkedObjects = new ArrayList(this.olv.CheckedObjects);
replacedert.AreEqual(3, checkedObjects.Count);
replacedert.IsTrue(checkedObjects.Contains(last));
replacedert.IsTrue(checkedObjects.Contains(P1));
replacedert.IsTrue(checkedObjects.Contains(GP2));
replacedert.IsFalse(checkedObjects.Contains(GGP1));
replacedert.IsTrue(this.olv.IsChecked(last));
replacedert.IsTrue(this.olv.IsChecked(P1));
replacedert.IsTrue(this.olv.IsChecked(GP2));
replacedert.IsTrue(this.olv.IsCheckedIndeterminate(GGP1));
// When GP1 is checked, GGP1 should also become checked.
this.olv.CheckObject(GP1);
replacedert.IsTrue(this.olv.IsChecked(GP1));
replacedert.IsTrue(this.olv.IsChecked(GGP1));
}
19
Source : TestWindowsCredentialAdapter.cs
with Apache License 2.0
from GoogleCloudPlatform
with Apache License 2.0
from GoogleCloudPlatform
[Test]
public async Task WhenUserDoesntExist_ThenCreateWindowsCredentialsCreatesNewUser(
[WindowsInstance] ResourceTask<InstanceLocator> testInstance,
[Credential(Role = PredefinedRole.ComputeInstanceAdminV1)] ResourceTask<ICredential> credential)
{
var adapter = new WindowsCredentialAdapter(new ComputeEngineAdapter(await credential));
var username = "test" + Guid.NewGuid().ToString().Substring(20);
var credentials = await adapter.CreateWindowsCredentialsAsync(
await testInstance,
username,
UserFlags.AddToAdministrators,
CancellationToken.None)
.ConfigureAwait(false);
replacedert.AreEqual(username, credentials.UserName);
replacedert.IsEmpty(credentials.Domain);
replacedert.IsNotEmpty(credentials.Preplacedword);
}
See More Examples