Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Val1 Val2 1 2 3 4 5 1 2 3 4 0

I need to connect one files to this program. It is a C# program. Can you help me?Unit testusing System;using Microsoft.VisualStudio.TestTools.UnitTesting;namespace TestProject1{[TestClass]public class UnitTest1{private TestContext context;public TestContext TestContext{get { return context; }set { context = value; }}[DeploymentItem("testdatasource.laccdb"), DeploymentItem("testdatasource.accdb"), TestMethod()][DataSource("System.Data.OleDb", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\testdatasource.laccdb", "MyDataTable", DataAccessMethod.Sequential)]public void MyTestMethod(){int a = Int32.Parse(TestContext.DataRow["Arg1"].ToString());int b = Int32.Parse(TestContext.DataRow["Arg2"].ToString());Assert.AreNotEqual(a, b, "A value was equal.");}[TestMethod()][DeploymentItem("MyTestProject\data.xlsx")][DataSource("MyExcelDataSource")]public void MyTestMethod2(){Assert.AreEqual(context.DataRow["Val1"], context.DataRow["Val2"]);}}}app.config<?xml version="1.0" encoding="utf-8" ?><configuration> <configSections><section name="microsoft.visualstudio.testtools" type="Microsoft.VisualStudio.TestTools.UnitTesting.TestConfigurationSection, Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/><!--<section name="microsoft.visualstudio.testtools" type="Microsoft.VisualStudio.TestTools.UnitTesting.TestConfigurationSection, Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />--> </configSections> <connectionStrings><add name="MyJetConn" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:MyTestProjecttestdatasource.accdb; Persist Security Info=False;" providerName="System.Data.OleDb" /><add name="MyExcelConn" connectionString="Dsn=Excel Files;dbq=C:data.xlsx;defaultdir=.; driverid=790;maxbuffersize=2048;pagetimeout=5" providerName="System.Data.Odbc" /> </connectionStrings> <microsoft.visualstudio.testtools><dataSources><add name="MyJetDataSource" connectionString="MyJetConn" dataTableName="MyDataTable" dataAccessMethod="Sequential"/><add name="MyExcelDataSource" connectionString="MyExcelConn" dataTableName="Sheet1$" dataAccessMethod="Sequential"/></dataSources> </microsoft.visualstudio.testtools></configuration>

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question