Showing posts with label Unit Testing. Show all posts
Showing posts with label Unit Testing. Show all posts

Thursday, August 13, 2015

Unit Testing with NBuilder and NSubstitute using either a FakeDBSet or a mock DbSet


In the previous blog post I showed how you can unit test with NBuilder and NSubstitute by using a FakeDbSet implementation. The thing is that we do not necessarily have to use a FakeDbSet but can also try and mock the DbSet. Let's see how we can changes the implementation from last week's blog post to mock DbSet instead. First thing to note is that a lot of examples for mocking the DbSet using other mocking frameworks such as Moq (such as this one) will demonstrate using DbSet and IQueryable, but it turns out that people using NSubstitute run into all sort of problems with this, as this SO question demonstrates. The solution seems to be to use IDbSet throughout. Both for defining the type of your DbSet in the DbContext, and also when mocking the DbSet.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

Unit Testing,NSBuilder,Nsubstitute,.Net

Thursday, June 25, 2015

How To Start Unit Testing in Swift


Last week I wrote about code quality and one area I covered was unit testing. Unit testing is the process of validating that pieces of your code operate as you expect. As you can imagine, this is a very useful aid in software development. If you're only using your eyes to determine if your app is functioning you're leaning on hope. The hope, being, that the house doesn't come crumbling down since you can't confidently say that everything works. The moment you ship the app to the store is one filled with anxiety. Undoubtably you discover a soul-crushing bug(s) that you scramble to push to the store, waiting on the Apple overlords.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

iPad,iPhone,iPhone Resources,iPhone Articles,iPhone Development,iPhone Turorial,Mobile Development Tutorials,Mobile Developments,Swift,Unit Testing

Monday, January 13, 2014

Unit Testing SQL Server OLAP Cubes Using C#


I feel a little like Thomas Jefferson when I say, "We hold these truths to be self-evident, that all code has certain unalienable rights and that among these rights is the ability to be thoroughly unit tested in a simple and concise way so bugs can be easily identified and production outages minimized." A bit dramatic, yes, but it gets my point across. Of course, most developers believe their code should be unit tested, but what happens when the definition of "code" is blurred? This was the situation I found myself in recently when presented with a complicated issue and tasked to find a solution. A group of developers was involved with writing a complex online analytical processing (OLAP) cube using SQL Server Analysis Services (SSAS). This cube had numerous dimensions all tied to an extremely complex fact table. Because the developers were quite skilled at developing cubes, they were able to piece the cube together, but validating the results of their Multidimensional Expressions (MDX) queries was a daunting task. The difficulty was compounded by a number of factors, including the amount of data in the dimensions and fact table, as well as the time and computing resources needed to build the cube. Once the cube was built, the results (produced by MDX queries) were sent to the users. If the users found an issue with the data, it would take a long time to track the problem down. Also, once the underlying problem was discovered and fixed, the cube would need to be regenerated. To make matters worse, if dimensions were added, the underlying fact table was updated or the cube was built using different aggregations, there was no way to determine the full effects of these changes. A seemingly innocent change could have a far-reaching and cascading effect on queries to the cube.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Unit Testing,Intermediate,SQL Server OLAP Cubes,SQL Server,OLAP Cubes,.Net,Articles,Computer Tutorials

Tuesday, December 31, 2013

Visual studio 2012 Fakes


In this article we will make a deep dive into VS 2012 Fakes. In order to understand Fakes in VS 2012 properly, you must understand Unit Testing first. That's why it will be better if I speak about it first.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Visual studio 2012 Fakes,Unit Testing

Wednesday, October 23, 2013

Silverlight ViewModel Unit Testing (RIA Services)


Unit Testing of Silverlight ViewModels with the RIA Services back-end has been a real problem since the asynchronous DomainContext which is used in the ViewModels to access service methods can't be mocked with usual methods. In this article the approach is described which doesn't require any additional libraries and dependences and makes it possible to create understandable unit tests. This approach is based on Brian Noyes article, and in fact just extends it to make things more effective:


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

C#,.NET,Architect,Intermediate,VS2012,.Net,Articles,Computer Tutorials,Silverlight,RIA Service,Unit Testing

Wednesday, June 19, 2013

TestFixtureSetUp and TestFixtureTearDown in Unit Testing using NUnit: Part 4


In Part 2 , we discussed about TestSetUp and TearDown. If notice TestSetUP and TearDown is related to tests. They both get executed each time a test get executed. So if there are 5 tests in Test Fixture then TestSetUp and TearDown will get executed 5 times. Sometime this is good and needed for certain requirements. However doing heavy tasks like cleaning up whole database etc. each time for a test may not be a good idea. You may want to perform certain task for whole test fixture than for each and individual tests.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Unit Testing,NUnit

Monday, June 17, 2013

Test SetUp and TearDown in Unit Testing using NUnit : Part 2


In last post we talked about how to start with Unit Testing using NUnit. In this post I will discuss about following two topics, Test Setup Test Teardown You need Test Setup and Test Teardown to remove any dependency between tests. Assume a scenario that


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials,Unit Testing, NUnit

Wednesday, May 15, 2013

JustCode Delivers Again! Painless Unit Testing in WinJS Applications


One of the biggest complaints I hear as I travel around the world promoting Modern Application Development with WinJS is the lack of support for WinJS unit testing. Those that follow this blog know that I am a huge proponent of unit testing, and some have even commented that I've been relatively dark on the subject when I write about WinJS development.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>Architect,Intermediate,Articles,Computer Tutorials, Telerik, RadControls, JustCode, WinJS, Unit Testing

Monday, April 29, 2013

JustCode Delivers Again! Painless Unit Testing in WinJS Applications


One of the biggest complaints I hear as I travel around the world promoting Modern Application Development with WinJS is the lack of support for WinJS unit testing. Those that follow this blog know that I am a huge proponent of unit testing, and some have even commented that I've been relatively dark on the subject when I write about WinJS development.


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

</ span>Architect,Intermediate,Articles,Computer Tutorials, Telerik, WinJs, Unit Testing, JustCode

Friday, February 8, 2013

Unit Testing using Visual Studio 2012


In this article, I am going to explain Unit Testing and how it can be performed using Visual Studio 2012. As you all know, Unit Testing is a method by which individual unit of source code or set of modules to test if they are ready for use. The primary goal of unit testing is to [...]

✔ Read More...


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

Testing using Visual Studio, Unit Testing, Unit Testing using Visual Studio 2012, Testing Using VS2012, VS2012 Testing, VS 2012 Unit Testing, Unit Test, Test Object, Calculator Test

Thursday, January 17, 2013

How to do Unit Test using NUnit : Part 1


Unit Testing is essential part of any production code. We can see rise of Test Driven Development (TDD) approach in many development projects. There are certain pros and cons of TDD but certainly we cannot ignore TDD way of software development. I read many blogs and tweets about TDD and got inspired to do some testing. I started learning to do unit testing of my codes. On searching I found NUnit an open source Unit Testing framework is the optimum way to start with Unit Testing. I downloaded NUnit from here and started my testing journey. After successful installation you will get NUnit GUI shown in below image,


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

Computer Tutorials,NUnit,Unit Testing

Thursday, January 10, 2013

Your First Objective-C Unit Test


Testing is important for writing clean, bug-free code. Fortunately, if you're writing iOS apps, Apple's Xcode has unit testing capabilities built in. Ash Furrow shows you how it works and walks you through the creation of some actual tests - including using them to understand an error in your code.

✔ Read More...

I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


This article is related to

iPad,iPhone,iPhone Resources,iPhone Articles,iPhone Development,iPhone Turorial,Mobile Development Tutorials,Mobile Developments,Objective C,iPhone Testing,Objective C Test,Unit Testing

LinkWithin

LinkWithin

Like Us On Facebook and Receive All Updates!

You can also receive Free Email Updates:

Powered By Tutorails