Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBindingList Tests #1

Open
Grauenwolf opened this issue Jun 2, 2021 · 0 comments
Open

IBindingList Tests #1

Grauenwolf opened this issue Jun 2, 2021 · 0 comments

Comments

@Grauenwolf
Copy link
Owner

Old version

    @Tag("IBindingList")
	@TestAttribute
	public void @(Test.ClassName + "_IBindingList_AddNew")()
	{
		IBindingList objectUnderTest = CreateCollection();
		
		var originalCount = objectUnderTest.Count;

		if (objectUnderTest.AllowNew) 
		{
			objectUnderTest.AddNew();
			@Assert.AreEqual("originalCount + 1", "objectUnderTest.Count")
		}
	}		

    @Tag("IBindingList")
	@TestAttribute
	public void @(Test.ClassName + "_IBindingList_RemoveAt")()
	{
		IBindingList objectUnderTest = CreateCollection();

		var originalCount = objectUnderTest.Count;

		if (objectUnderTest.AllowRemove)
		{
			objectUnderTest.RemoveAt(0);
			@Assert.AreEqual("originalCount - 1", "objectUnderTest.Count")
		}
	}

    @Tag("IBindingList")
	@TestAttribute
	public void @(Test.ClassName + "_IBindingList_Remove")()
	{
		IBindingList objectUnderTest = CreateCollection();

		var originalCount = objectUnderTest.Count;

		if (objectUnderTest.AllowRemove)
		{
			objectUnderTest.Remove(objectUnderTest[0]);
			@Assert.AreEqual("originalCount - 1", "objectUnderTest.Count")
		}
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant