Comments (18)
I've just tried a Windows Store 8.1 unit test project from inside Visual Studio 2013 using the NuGet package for FA 2.1 and it just worked. One thing that surprised me is that you are using R# 8. Only R# 8.1 supports Visual Studio 2013.
Oh, and to test async methods, rewrite your action like this:
Func<Task> asyncFunction = async () => { await matchWorker.GetMatchAsync(string.Empty); };
from fluentassertions.
No, it's just that FA is referencing the v11 version of that assembly. Officially it doesn't support Windows 8.1 apps yet. I'll need to see if I can dynamic loading like I do with the full .NET versions.
from fluentassertions.
Uhm, I've always thought that Visual Studio 2013 will install the same binaries on Windows 8(.1) as on Windows 7.
According to http://www.jetbrains.com/resharper/download/
ReSharper 8 officially supports Visual Studio 2013, 2012, 2010, 2008 SP1, and 2005 SP1.
I've been using ReSharper 8 since the very first Preview of 2013 (Visual Studio 11 Developer Preview).
There is no difference if I write my action like
Action action = async () => await matchWorker.GetMatchAsync(string.Empty);
or
Action action = async () => { await matchWorker.GetMatchAsync(string.Empty); };
both fail when I run the tests either through R# or through NUnit.
The fun thing is: I've already managed to test Exceptions in the very same project as the one where my MatchWorker is, though I got the same FileNotFoundException every time I messed something up, i.e. an Assertion error.
from fluentassertions.
So I was wrong about R#. However you must definitely cannot create Windows 8.1 apps on Windows 7. That's why I cannot really upgrade FA to fully support WinRT 8.1. I would need to use two version of Visual Studio at the same time. 2012 only targets WinRT 8.0, whereas 2013 only targets WinRT 8.1.
So are you using Win8 or Win7?
from fluentassertions.
I'm on Windows 8.1 on three different machines :)
from fluentassertions.
Me too. So if you will, can you try something for me?
- Start Visual Studio 2013 RTM
- Create a Windows 8.1 Store Unit Test Project
- Add a reference to the FA Nuget package
- Create a single unit test that used an Action that throws and the ShouldThrow method
- Verify that it fails with the usual reporting rather than your FileNotFoundException
from fluentassertions.
Worked as intended. Actually, this is the first time I see human readable error messages :S
Is it a combination of me using NUnit and a regular Windows Store 8.1 Library instead of a Unit Test Library (which uses MSTest)?
from fluentassertions.
Ah, now I'm getting it. Your using a WinRT version of NUnit? I didn't account for that. In fact, I assumed everybody uses MSTest when building Windows Store apps.
from fluentassertions.
Well, I initially wanted to use MSTest but then I had to switch over to NUnit because of FakeItEasy =) Couldn't find any good Mocking Framework that also worked for Portable Class Libraries and Windows Store Apps.
At the moment I don't even know why I assumed that I need NUnit in order to use FakeItEasy - I've read that some people on StackOverflow (who are having problems :D) are using FakeItEasy with MSTest. So maybe it's time for me to switch the testing framework as well if it's working :D The still sad thing is that the NuGet package is not yet configured to support WinRT though it's working fine if you add the reference manually.
from fluentassertions.
Now I'm confused. Is your class library a Portable Class Library? Because I'm 100% sure FakeItEasy doesn't runder under the Windows Store run-time.
from fluentassertions.
I'm using FakeItEasy with Portable Class Libraries and with Windows Store 8.1 Libraries without any problems. I believe I added the SL version as reference.
from fluentassertions.
The screenshot shows the project that contains the code to test, but can you provide me with a similar screenshot for the actual project that is using FakeItEasy, NUnit and FluentAssertions? I just created a PCL that targeted .NET 4.5 and Windows Store and everything worked as expected.
from fluentassertions.
My PCL (VERSUS.Test.Mockable) contains a few base-classes that use FakeItEasy which are used in my Windows Store App Tests (VERSUS.Data.Test etc.).
At the moment there are no dedicated tests yet for my PCL project (not sure if I'll ever need one), NUnit is just referenced to mark the said base classes as Test class so I don't need to do that in the derived classes.
from fluentassertions.
So VERSUS.Data.Test is a real Windows Store Unit Test library? Because FakeItEasy will most definitely not work under the Windows Store runtime.
from fluentassertions.
Uhm, works for me :S
I've downloaded FakeItEasy in a simple .NET Console Application to get all assemblies, copied them to my Windows Store Library, added a reference to the SL40 assembly, added NUnit via NuGet --> Works!
Should I upload the whole test project as well?
Ninja-Edit The source code is available at https://bitbucket.org/cH40zLord/windows-store-test-with-fakeiteasy-and-nunit/overview (would have been better if I created a GitHub repo for that, huh? Didn't want to upload/commit a testing project as my first GitHub project :P I'd rather have a real project on GitHub instead of this... :D)
from fluentassertions.
Surprise! I've managed to reproduce the error in the test project!
An IOException is thrown every time you throw an Exception in an async method.
I've updated the code on Bitbucket
from fluentassertions.
So I managed to reproduce it with the project from Bitbucket. However, async
specs should use the following syntax:
Func<Task> action = async () => { await subject.ExceptionsInAsyncMethodsCrashFluentAssertionsInWinRT(string.Empty); };
Then the spec succeeds. But the problem is really with finding the unit test framework assembly to throw the correct exception type. Now investigating...
from fluentassertions.
Fixed it in the latest commit. I now added automatic detection of the PCL version of NUnit. If that's not available, it'll fall back to the MSTest framework.
from fluentassertions.
Related Issues (20)
- Add assertions on `JsonElement` HOT 3
- Incorrect line breaks handling with custom string comparer HOT 2
- ComparingEnumsByName() seems not to work as expected HOT 2
- Excluding and Including options should fail when applied on types with value semantics HOT 6
- Compare memberless records by value, others by members HOT 11
- Add support for asserting NaN values HOT 10
- Library is not compatible with .NET MAUI 8.0.6 HOT 3
- Add feature to check if an XElement or XAttribute is absent within the XDocument HOT 16
- Null reference exception when using custom comparer in equivalency options HOT 7
- [Feature]: Multi dimension arrays assertions HOT 10
- WithInnerException<T>() needs the type as a parameter HOT 2
- `Should().BeEquivalentTo` failing for identical objects HOT 3
- FluetntAssertion doesn't work correctly for records HOT 8
- Equivalency assertion option Excluding outputs "value(...<>c__DisplayClass).variableName" in some instances HOT 2
- Add string-option for ignoring newline style HOT 2
- Unexpected default equivalency behaviour with interfaces HOT 3
- ArgumentOutOfRangeException in FluentAssertions.Equivalency.Tracing.StringBuilderTraceWriter.ToString() HOT 8
- FluentAssertions: using a NullorEqual string EqualityComparer still returns a type difference error HOT 2
- [API Proposal]: Allow to assert RegEx matched groups HOT 3
- BeXmlSerializable does not respect XmlIgnoreAttribute HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentassertions.