Object-oriented unit test [closed]

1

I'm trying to do an object-oriented unit test, and the same is saying that the object was not instantiated.

Follow the code:

[DataSource("Microsoft.VisualStudio.TestTools.DataSource.XML",
           "|DataDirectory|\MassaDados\MassaDados.xml",
           "GruposSubgrupos", DataAccessMethod.Sequential)]
[Timeout(TestTimeout.Infinite)]
[TestMethod]
[DeploymentItem(@"MassaDados")]
[DeploymentItem(@"ChefWeb\Data")]
public void TestMethod0250_GruposSubgrupos()
{
#if RELEASE
    try
    {
#endif
    browser = Util.Inicializa();
    Menu.NavegarAdmFranquia_GrupoSubgrupo(browser);
    Util.AguardarWaitPanel(browser);

    var searchTimeout = Playback.PlaybackSettings.SearchTimeout;
    Playback.PlaybackSettings.SearchTimeout = 4000;

    while (!BrowserWindow.Locate("Grupos e Subgrupo").Exists) ;
    {
        Playback.Wait(2000);
    }
    Playback.PlaybackSettings.SearchTimeout = searchTimeout;
    browser = BrowserWindow.Locate("Grupos e Subgrupo");
    Util.AguardarWaitPanel(browser);

    var loja = Util.RetornarLoja();
    var objTeste = new CadastroGrupoSubgrupo();
    var objTesteDados = objTeste.PreencherClasseGrupoSubGrupo(TestContext, loja);

    Validacao val = new Validacao();
    objTeste.GerenciarGrupoSubgrupo(browser, objTesteDados);
    if (!objTesteDados.VinculadoAProduto)
    {
        var DtConfigInicial = new DataTable();
        DtConfigInicial = Util.CarregarConfigInicial();
        if (DtConfigInicial.Rows[0]["Validar_BancoDados"] != DBNull.Value)
        {
            if (DtConfigInicial.Rows[0]["Validar_BancoDadoos"].ToString().ToUpper() == "SIM")
                val.ValidarBD(TestContext.DataRow, TestContext.DataRow.Table.TableName, objTesteDados.Operacao, false);
        }
    }
    Util.AtualizarStatusTFS(TestContext, "Sucesso");
    Util.NavegarUrlChefWeb(browser);


#if RELEASE
    }
    catch (Exception ex)
    {
        Util.AtualizarStatusTFS(TestContext, "Falha");
        Util.NavegarUrlChefWeb(browser);
        throw ex;
    }
#endif
    Playback.Wait(3000);
}
    
asked by anonymous 09.03.2017 / 18:11

0 answers