CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of testing
C#
/// <summary>
/// Holds up the test execution for the given duration without blocking the UI thread.
/// </summary>
void UIPause(int sec)
{
    Storyboard PauseSB = new Storyboard() { Duration = new Duration(new TimeSpan(0, 0, sec)) };
    PauseSB.Completed += (sender, e) => { TestComplete(); };
    PauseSB.Begin();
}
454 Views
no comments
 
C#
public void Send_DatabaseTimeOutNewsletterFails_LastPublishDateNotChanged()
{          
    //Arrange
    var originalNewsletter = new AutomaticNewsletter()
                         {
                             Id = 1,
                             Name = "TestNewsletter",
                             LastPublishStatus = PublishStatus.NotSent,
                             LastPublishDate = new DateTime(2000, 01, 01),
                             PublishDay = DayOfWeek.Friday,
by serbrech   January 27, 2010 @ 4:28am
215 Views
no comments
 
C#
[TestMethod]
public void CanGetValueItemfromCollection()
{
    var col = new Collection<string> {"Hello", "World"};
    var testItem = col.GetValueItem(c => c.Equals("World"));
    Assert.AreEqual(testItem, "World");
}
 
[TestMethod]
public void CanGetReferenceItemfromCollectionByProperty()
by Bob Baker   December 18, 2009 @ 12:01pm
302 Views
no comments
 
C#
public class EnableArtistTrackActionSpecs
{
    private readonly Playlist playlistFake;
    private readonly ArtistTrack trackToEnable;
 
    public EnableArtistTrackActionSpecs()
    {
        playlistFake = new Playlist();
        trackToEnable = MockRepository.GenerateStub<ArtistTrack>();
    }
by Scott Muc   October 29, 2009 @ 3:40pm
222 Views
no comments
 
C#
// **********************************
// By Roy Osherove : www.osherove.com
// see example usage of this code at http://weblogs.asp.net/rosherove/archive/2009/10/23/typemoq-api.aspx 
// **********************************
 
using System;
using System.Linq;
using System.Linq.Expressions;
using TypeMock.ArrangeActAssert;
by Roy Osherove   October 23, 2009 @ 6:08am
687 Views
no comments
 
C#
//Class Under Test
public class CategoryRepository : BaseRepository<Category>
{
    //EntityContainer is an ObjectContext
    public CategoryRepository(EntityContainer context)
        : base(context){}
 
    //Method Under Test
    public Category FindById(Guid id)
    {
by Muhammad Mosa   September 02, 2009 @ 10:58am
479 Views
no comments
 
C#
namespace Repository.EntityFramework
{
    //Entity Class Under Test
    public partial class Story
    {
        public ICollection<Tag> Tags
        {
            get
            {
                if(!TagsInternal.IsLoaded)
by Muhammad Mosa   September 01, 2009 @ 2:38pm
354 Views
no comments
 
C#
//Class under test code snippet
public class CategoryRepository : BaseRepository<Category>
{
        //EntityContainer class is an ObjectContext of Entity Framework
        public CategoryRepository(EntityContainer context)
            : base(context)
        {
        }
        public override void Add(Category category)
        {
by Muhammad Mosa   August 31, 2009 @ 1:55pm
333 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate