Example #1
0
        public void TestAssetRequest_Respond_AssetError_AssetError_AssetAlreadySetException()
        {
            var req = new AssetRequest(_asset.Id, a => { }, a => { });

            req.Respond(new AssetError());
            Assert.Throws <AssetAlreadySetException>(() => req.Respond(new AssetError()));
        }
Example #2
0
        public void TestAssetRequest_Respond_StratusAsset_StratusAsset_AssetAlreadySetException()
        {
            var req = new AssetRequest(_asset.Id, a => { }, a => { });

            req.Respond(_asset);
            Assert.Throws <AssetAlreadySetException>(() => req.Respond(_asset));
        }
Example #3
0
        public void TestAssetRequest_Respond_AssetError_CallsHandler()
        {
            var gotCallback = false;
            var req         = new AssetRequest(_asset.Id, a => { }, a => gotCallback = true);

            req.Respond(new AssetError());
            Assert.True(gotCallback);
        }
Example #4
0
        public void TestAssetRequest_Respond_StratusAsset_CallsHandler()
        {
            var gotCallback = false;
            var req         = new AssetRequest(_asset.Id, a => gotCallback = true, a => { });

            req.Respond(_asset);
            Assert.True(gotCallback);
        }
Example #5
0
        public void TestAssetRequest_Respond_StratusAsset_DoesNotThrow()
        {
            var req = new AssetRequest(_asset.Id, a => { }, a => { });

            Assert.DoesNotThrow(() => req.Respond(_asset));
        }
Example #6
0
        public void TestAssetRequest_Respond_StratusAsset_WrongId_AssetIdMismatchException()
        {
            var req = new AssetRequest(Guid.NewGuid(), a => { }, a => { });

            Assert.Throws <AssetIdMismatchException>(() => req.Respond(_asset));
        }
Example #7
0
        public void TestAssetRequest_Respond_StratusAsset_null_ArgumentNullException()
        {
            var req = new AssetRequest(Guid.NewGuid(), a => { }, a => { });

            Assert.Throws <ArgumentNullException>(() => req.Respond(null));
        }