Пример #1
0
        public void TestOblivionRendererInfo_Stream()
        {
            const string contents = @"
	SLI mode                : no
	Water shader            : yes
	Water reflections       : maybe
	Water displacement      : possible
	Water high res          : certainly
	Multisample Type        : 0
	Shader Package          : 13"            ;

            var bytes = Encoding.UTF8.GetBytes(contents);

            using var ms = new MemoryStream(bytes.Length);
            ms.Write(bytes, 0, bytes.Length);
            ms.Position = 0;

            var sliMode           = OblivionRendererInfo.GetRendererInfo(ms, "SLI mode");
            var waterShader       = OblivionRendererInfo.GetRendererInfo(ms, "Water shader");
            var waterReflections  = OblivionRendererInfo.GetRendererInfo(ms, "Water reflections");
            var waterDisplacement = OblivionRendererInfo.GetRendererInfo(ms, "Water displacement");
            var waterHighRes      = OblivionRendererInfo.GetRendererInfo(ms, "Water high res");
            var multisampleType   = OblivionRendererInfo.GetRendererInfo(ms, "Multisample Type");
            var shaderPackage     = OblivionRendererInfo.GetRendererInfo(ms, "Shader Package");
            var nothing           = OblivionRendererInfo.GetRendererInfo(ms, "This does not exist");

            Assert.Equal("no", sliMode);
            Assert.Equal("yes", waterShader);
            Assert.Equal("maybe", waterReflections);
            Assert.Equal("possible", waterDisplacement);
            Assert.Equal("certainly", waterHighRes);
            Assert.Equal("0", multisampleType);
            Assert.Equal("13", shaderPackage);
            Assert.Null(nothing);
        }
Пример #2
0
        public void TestOblivionRendererInfo_File()
        {
            const string file     = "oblivion-test-rendererInfo.txt";
            const string contents = @"
	SLI mode                : no
	Water shader            : yes
	Water reflections       : maybe
	Water displacement      : possible
	Water high res          : certainly
	Multisample Type        : 0
	Shader Package          : 13"            ;

            File.WriteAllText(file, contents, Encoding.UTF8);

            var sliMode           = OblivionRendererInfo.GetRendererInfo(file, "SLI mode");
            var waterShader       = OblivionRendererInfo.GetRendererInfo(file, "Water shader");
            var waterReflections  = OblivionRendererInfo.GetRendererInfo(file, "Water reflections");
            var waterDisplacement = OblivionRendererInfo.GetRendererInfo(file, "Water displacement");
            var waterHighRes      = OblivionRendererInfo.GetRendererInfo(file, "Water high res");
            var multisampleType   = OblivionRendererInfo.GetRendererInfo(file, "Multisample Type");
            var shaderPackage     = OblivionRendererInfo.GetRendererInfo(file, "Shader Package");
            var nothing           = OblivionRendererInfo.GetRendererInfo(file, "This does not exist");

            Assert.Equal("no", sliMode);
            Assert.Equal("yes", waterShader);
            Assert.Equal("maybe", waterReflections);
            Assert.Equal("possible", waterDisplacement);
            Assert.Equal("certainly", waterHighRes);
            Assert.Equal("0", multisampleType);
            Assert.Equal("13", shaderPackage);
            Assert.Null(nothing);
        }