Execute() public method

public Execute ( object testClass ) : Xunit.Sdk.MethodResult
testClass object
return Xunit.Sdk.MethodResult
Esempio n. 1
0
        public void ExecuteSuccessfullyReturnsCorrectResult()
        {
            Action<object> testAction = _ => { };
            var sut = new FirstClassCommand(testAction, anotherMethod, false);

            var actual = sut.Execute(new object());

            var pr = Assert.IsAssignableFrom<PassedResult>(actual);
            Assert.Equal(anotherMethod.Name, pr.MethodName);
            Assert.Equal(anotherMethod.TypeName, pr.TypeName);
        }
Esempio n. 2
0
        public void ExecuteInvokesAction()
        {
            var verified = false;
            var obj = new object();
            Action<object> spy = x => verified = x == obj;
            var sut = new FirstClassCommand(spy, dummyMethod, false);

            sut.Execute(obj);

            Assert.True(verified, "Spy should have been invoked.");
        }