Exemplo n.º 1
0
        public async Task OneTime_Does_Not_Listen_To_Any_Object(ViewModelTestBase dataContext,
                                                                params ViewModelTestBase[] children)
        {
            var test = new TestInContext()
            {
                Bind = (win) => Bind(win, dataContext, JavascriptBindingMode.OneTime),
                Test = (mb) => { children.ForEach(child => child.ListenerCount.Should().Be(0)); }
            };

            await RunAsync(test);
        }
Exemplo n.º 2
0
        public async Task TwoWay_Listens_Only_Once_To_Each_Object(ViewModelTestBase dataContext,
                                                                  params ViewModelTestBase[] children)
        {
            var test = new TestInContext()
            {
                Bind = (win) => Bind(win, dataContext, JavascriptBindingMode.TwoWay),
                Test = (mb) => { children.ForEach(child => child.ListenerCount.Should().Be(1)); }
            };

            await RunAsync(test);
        }
Exemplo n.º 3
0
        public async Task TwoWay_Unlistens_After_Dispose(ViewModelTestBase datacontext, params ViewModelTestBase[] children)
        {
            var test = new TestInContextAsync()
            {
                Bind = (win) => Bind(win, datacontext, JavascriptBindingMode.TwoWay),
                Test = async(mb) =>
                {
                    await DoSafeAsyncUI(mb.Dispose);

                    children.ForEach(child => child.ListenerCount.Should().Be(0));
                }
            };

            await RunAsync(test);
        }