コード例 #1
0
        public void WhenHttpContextIsNotAvailableThenGetAssemblyFromCurrentExecutingAssembly()
        {
            var fakeAssemblyLoader = new FakeAssemblyLoader(GetType().Assembly);
            var assemblyResolver   = new WebAssemblyResolver(null, fakeAssemblyLoader);

            var resolvedAssembly = assemblyResolver.GetApplicationAssembly();

            Assert.That(resolvedAssembly, Is.EqualTo(GetType().Assembly));
        }
コード例 #2
0
        public void WhenHttpContextIsAvailableGetAssemblyFromApplicationInstanceAssembly()
        {
            var fakeHttpContext  = FakeHttpContext.For(new FakeHttpApplication());
            var assemblyResolver = new WebAssemblyResolver(fakeHttpContext, null);

            var resolvedAssembly            = assemblyResolver.GetApplicationAssembly();
            var fakeHttpApplicationAssembly = fakeHttpContext.ApplicationInstance.GetType().Assembly;

            Assert.That(resolvedAssembly, Is.EqualTo(fakeHttpApplicationAssembly));
        }