19 AĞUSTOS 2013, PAZARTESİ
Test yöntemi yetersizdir: Test edilmedi't çalıştırın. Hata mı?
Test Dersim var ve test sınıfından örnek bir test attılar aşağıda
namespace AdminPortal.Tests.Controller_Test.Customer
{
[TestClass]
public class BusinessUnitControllerTests
{
private IBusinessUnitRepository _mockBusinessUnitRepository;
private BusinessUnitController _controller;
[TestInitialize]
public void TestInitialize()
{
_mockBusinessUnitRepository = MockRepository.GenerateMock<IBusinessUnitRepository>();
_controller = new BusinessUnitController(_mockBusinessUnitRepository);
}
[TestCleanup]
public void TestCleanup()
{
_mockBusinessUnitRepository = null;
_controller.Dispose();
_controller = null;
}
#region Index Action Tests
[TestMethod]
public void Index_Action_Calls_GetAllBusinessUnit()
{
_mockBusinessUnitRepository.Stub(x => x.GetAllBusinessUnit());
_controller.Index();
_mockBusinessUnitRepository.AssertWasCalled(x=>x.GetAllBusinessUnit());
}
}
}
Ekran aşağıdaki ben projeyi çalıştırdığımda
Referansları kontrol ve test proje ana proje başvurusu var. Testi ya da yetersiz olduğunu söyleyerek, neden herhangi bir fikir?
Edit 1:
Post here gördüm ve X 64 için benim test ayarı varsayılan işlemci mimarisi değişti ama hala çalışmıyor.
CEVAP
27 Ocak 2014, PAZARTESİ
Her ihtimale karşı yukarıdaki seçeneklerden hiçbiri benim App bozuk bir giriş fark ederek bu hatanın benim örnek hazırladım herkes için çalıştı.Yapılandırma projesinin eksik nuget paketi nedeniyle.
Bunu Paylaş:
Yazmayı yasemin - bir Hata atılmayı be...
Nasıl Selenyum çalıştırın Krom test ça...
Alay HttpContext.Test geçerli Init Yön...
Maven ile tek bir test yöntemi Çalıştı...
Nasıl bir test yöntemi çalıştırmak içi...