简体   繁体   中英

How to assert exceptions with Bddfy

I am trying to use Test Stack Bddfy with MSTest and am running into an interesting issue. I have a piece of code where I am expecting an exception to be thrown. I am specifying that in MSTest tests and they are rightly passing. However Bddfy sees that exception as a problem and shows failing test in it's Html report. My method is simple

        [TestMethod, ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void Run()
        {
            this.BDDfy();
        }

How can I tell Bddfy that I am expecting exception of some type in this test?

I could not find Bddfy tag here so just tagging with MsTest.

Thanks,

I found this Q&A on their web page, check it out. Hope it helps! https://github.com/TestStack/TestStack.BDDfy/issues/14

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM