我正在尝试运行此系统测试。我确保设备信息在数据库中。
当我运行测试时,它不断给我一条错误消息:
测试方法 SystemTests.Tests.EmailNotification.TestAddDeviceToAccount 抛出异常:System.InvalidOperationException:序列不包含任何元素。
请有任何帮助
public void TestAddDeviceToAccount()//Test to AssDeviceToAccount
{
//string Fccid = "OPS2";
//string SerialNumber = "101";
//string emailAddress = "m.koneru2@spectrumBridge.com";
using (WSPlusEntities dc = WSPlusEntities.GetContext())
{
Device d1 = dc.Devices.Where(d => d.FCCID == "OPS2" && d.SerialNumber == "101").Single();
d1.NetworkId = 1;
//var deviceList = dc1.Devices.Where(d => d.FCCID == "OPS2" && d.SerialNumber == "102").ToList();
//foreach (var d2 in deviceList)
//d2.NetworkId = 1;
dc.SaveChanges();
}
}