コード例 #1
0
        public void Extensions_GetPhysicalFileName_Returns_Null_If_No_FileName_In_Entity_Connection_String()
        {
            // Arrange
            DbConnectionStringBuilder value = new System.Data.EntityClient.EntityConnectionStringBuilder(
                @"metadata=res://*/MyData.csdl|res://*/MyData.ssdl|res://*/MyData.msl;provider=System.Data.SqlClient;provider connection string="";data source=.;integrated security=True;MultipleActiveResultSets=True""");

            // Act
            string actual = value.GetPhysicalFileName();

            // Assert
            Assert.IsNull(actual, "GetPhysicalFileName() returned incorrect value.  Value: {0}", actual);
        }
コード例 #2
0
        public void Extensions_GetPhysicalFileName_Returns_FileName_If_Entity_Connection_String()
        {
            // Arrange
            DbConnectionStringBuilder value = new System.Data.EntityClient.EntityConnectionStringBuilder(
                @"metadata=res://*/MyData.csdl|res://*/MyData.ssdl|res://*/MyData.msl;provider=System.Data.SqlClient;provider connection string="";data source=.;AttachDBFilename=C:\MyDatabase.mdf;integrated security=True;MultipleActiveResultSets=True""");

            // Act
            string actual = value.GetPhysicalFileName();

            // Assert
            Assert.AreEqual(@"C:\MyDatabase.mdf", actual, "GetPhysicalFileName() returned incorrect value.");
        }