VBA Rubberducking

This chat has moved to Discord: discord.gg/MYX9RECenJ
Apr 17, 2015 20:44
jey NYMBURK, CZ, it's me!
Apr 17, 2015 20:38
but guys, don't spend too much time now. I just wanted to know what is your thinking about it. It's really a feature for RD 3.0 or so
Apr 17, 2015 20:36
@Mat'sMug me neither, I meant the way how they create a snippet setting - msdn.microsoft.com/en-us/library/ms165394.aspx
Apr 17, 2015 20:31
@RubberDuck well you can do a bit more if you'd implement it like MS but I agree that for example for "Progress bar" snippet, which will probably include a form and at least one class, it's not possible. I mean the MS way. At least I don't have idea how
Apr 17, 2015 20:22
@FreeMan lol
Apr 17, 2015 20:21
hey that was my idea :)
Apr 17, 2015 20:21
exactly!
Apr 17, 2015 20:21
ups pulling =pooling
Apr 17, 2015 20:20
@Mat'sMug hehe then you'd see bad code. No really, I can see a huge potential with this feature. All the queries about - progress bar, download data, send email from excel, database connection/pulling => all sorted :)
Apr 17, 2015 20:09
@RubberDuck sure. no problem
Apr 17, 2015 19:59
@Mat'sMug understand, are you planning it something like MS does? msdn.microsoft.com/en-us/library/ms165392.aspx
Apr 17, 2015 19:35
#332 github.com/retailcoder/Rubberduck/issues/332 I've been thinking about it a bit. What is the plan with it?
Apr 17, 2015 19:21
@Mat'sMug OK, I need to make some progress on that project I mentioned so I'll check this later but seeing it as cool and important feature so we should make the tests working again and add others
Apr 17, 2015 19:14
@Mat'sMug I'll check that. Is that something what can be mocked? @RubberDuck Have you had chance to check the PR with the one test? The Cast issue. Isaw you're pretty busy with your class so not rush yourself
Apr 17, 2015 19:08
Anyway I presenting your tool wherever I go. I'm going to use Ducky unit test in that project, it's on the project's wiki, so it's official :)
Apr 17, 2015 19:06
@Mat'sMug ok guys, just wanted to know u r aware about it. Unfortunately I had to unload the addin :(
Apr 17, 2015 19:03
is this normal?
Apr 17, 2015 19:03
and when I go to VBE, it takes about 1 minute (50 sec to be precise) to refresh all data for ducky
Apr 17, 2015 19:03
I've been working on quite huge project, something like 200 components
Apr 17, 2015 19:02
@Mat'sMug one of my favourite
Apr 17, 2015 19:02
wanted to ask you guys
Apr 17, 2015 19:02
welcome in my world
Apr 17, 2015 19:01
something like "I can't look at the code without crying"
Apr 17, 2015 19:01
np, I like your comment in one of the commit you sent
Apr 17, 2015 19:00
thank you :)
Apr 17, 2015 19:00
I saw! :)
Apr 17, 2015 19:00
hey @Mat'sMug
Apr 10, 2015 20:53
@Mat'sMug yep, sometimes it will save me hours. My wife is running 64bit office just because of this :)
Apr 10, 2015 20:27
@Mat'sMug Looking at the time you usually send the most commits... Man, you work hard and late!
Apr 10, 2015 20:23
@RubberDuck not bad, sunny day, Friday. Yeah pretty good. Going to suggest a feature for RubberDuck 2.0 :)
Apr 10, 2015 20:12
@Mat'sMug it's me
Apr 9, 2015 22:23
@Duga @RubberDuck @Mat'sMug this one is about the mysterious Cast problem, just one test to show you what I had to do to solve it. I'm sure, Moq can do that, I just don't know how. Thanks!
Apr 8, 2015 22:35
@RubberDuck @RubberDuck I'll do that tomorrow. Can test it now but the results don't look good
Apr 8, 2015 20:34
is this how it works?
Apr 8, 2015 20:34
@RubberDuck wait, I'll create a new branch in my forked project and then make a PR and you will be able to merge it to your project?
Apr 8, 2015 20:30
@RubberDuck good question, I don't know :) don't forget, first time I use Git.. I thought I'll continue committing to my forked branch and then make a PR?
Apr 8, 2015 20:26
@RubberDuck sure, take your time, it's not important/critical, we can even skip it for now
Apr 8, 2015 20:23
@RubberDuck did you fix the sln file? So I can commit and you can try if you get time?
Apr 8, 2015 20:22
@RubberDuck the famous "Object null reference" I found how the Cast is implemented somewhere on StackOveflow and it really uses generic foreach, don't know why it doesn't work
Apr 8, 2015 20:20
@RubberDuck yep I tried it
Apr 8, 2015 20:14
as I said no rush, I'll continue with the fake class for now, once we solve it I'll replace it with the Mock instance
Apr 8, 2015 20:13
so yes I was right :), it even doesn't compile
Apr 8, 2015 20:10
@Mat'sMug nope it didn't work for me, but let me double check I tried too many options so I might missed that one
Apr 8, 2015 20:06
 public class VbProjectFake : VBProjects
    {

        private IEnumerable<VBProject> _projects;

        public VbProjectFake(IEnumerable<VBProject> projects )
        {
            _projects = projects;
        }

        public VBProject Add(vbext_ProjectType Type)
        {
            throw new NotImplementedException();
        }

        public int Count
        {
            get { return _projects.ToList().Count; }
        }

        public System.Collections.IEnumerator GetEnumerator()
Apr 8, 2015 20:06
 [TestMethod]
        public void TestCast()
        {
            Mock<VBProject> vbProject = new Mock<VBProject>();
            vbProject.Setup(x => x.Name).Returns("projectName");
            vbProject.Setup(x => x.Protection).Returns(vbext_ProjectProtection.vbext_pp_none);

            var projectList = new VBProject[] {vbProject.Object, vbProject.Object};
            // here is my workaround
            VBProjects vbProjects = new VbProjectFake(projectList);

            Mock<VBE> vbe = new Mock<VBE>();
Apr 8, 2015 20:04
one minute
Apr 8, 2015 20:04
ah, let me clean it a bit
Apr 8, 2015 20:03
should send you the code here? (I don't know how to format it properly here)
Apr 8, 2015 20:03
@Mat'sMug right
Apr 8, 2015 20:02
thanks, basically I have problem with this specific line
'vbe.VBProjects.Cast<VBProject>() ...'