How to write test case using Moq and Xunit for the following code?

243 Views Asked by At

Need to write the test case for the following code using moq and xunit. return null is not covered in code coverage

public static StreamReader GetStream(System.Reflection.Assembly assembly, string name)
    {
        foreach (string resName in assembly.GetManifestResourceNames())
        {
            if (resName.EndsWith(name))
            {
                return new System.IO.StreamReader(assembly.GetManifestResourceStream(resName));
            }
        }
        return null;
    }
0

There are 0 best solutions below