示例#1
0
        public void ReturnFileResourceResultWithResource()
        {
            var contextMock = new Mock <IResourceContext>();

            var resource = new ClientResource();

            var result = resource.Execute(contextMock.Object);

            Assert.NotNull(result);
        }
示例#2
0
        public void ReturnStatusCodeResourceResultWithMissingResource()
        {
            var contextMock = new Mock <IResourceContext>();

            var resource = new ClientResource {
                ResourceName = "wrong"
            };

            var result = resource.Execute(contextMock.Object);

            Assert.NotNull(result as StatusCodeResourceResult);
        }
示例#3
0
        public void ThrowExceptionWithNullParameters()
        {
            var resource = new ClientResource();

            Assert.Throws <ArgumentNullException>(() => resource.Execute(null));
        }